diff options
-rw-r--r-- | test/ruby/test_iterator.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb index f3c2201e0a..5c2ef183aa 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 |