diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_yield.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_yield.rb b/test/ruby/test_yield.rb index 3337aea078..143ee55a9f 100644 --- a/test/ruby/test_yield.rb +++ b/test/ruby/test_yield.rb @@ -379,4 +379,15 @@ class TestRubyYieldGen < Test::Unit::TestCase } end + def test_block_with_mock + y = Object.new + def y.s(a) + yield(a) + end + m = Object.new + def m.method_missing(*a) + super + end + assert_equal [m, nil], y.s(m){|a,b|[a,b]} + end end |