summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_iterator.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-10 22:57:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-10 22:57:38 +0000
commit0060fce568d277e8c6066796b9f796712c8ab93d (patch)
tree290f65cea2fa555da5982adcd127cf1d4f958d0d /test/ruby/test_iterator.rb
parent455cb372cbbe0866d213d99866cbf324802a1f41 (diff)
downloadruby-0060fce568d277e8c6066796b9f796712c8ab93d.tar.gz
ruby-0060fce568d277e8c6066796b9f796712c8ab93d.tar.xz
ruby-0060fce568d277e8c6066796b9f796712c8ab93d.zip
* test/ruby/test_iterator.rb (test_block_passing): yield in method
argument behaves differently. [ruby-dev:26274] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_iterator.rb')
-rw-r--r--test/ruby/test_iterator.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb
index cf9a6fdb3..738e97446 100644
--- a/test/ruby/test_iterator.rb
+++ b/test/ruby/test_iterator.rb
@@ -189,6 +189,14 @@ class TestIterator < Test::Unit::TestCase
assert(!m2())
end
+ def m3(var, &block)
+ m(yield(var), &block)
+ end
+
+ def test_block_passing
+ assert_equal(100, m3(10) {|x|x*x})
+ end
+
class C
include Enumerable
def initialize