aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_yield.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_yield.rb')
-rw-r--r--test/ruby/test_yield.rb11
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