diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | test/ruby/test_super.rb | 18 |
2 files changed, 22 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Mon Oct 27 16:26:37 2014 Koichi Sasada <ko1@atdot.net> + + * test/ruby/test_super.rb: add a test to check block passing. + Mon Oct 27 15:59:26 2014 Koichi Sasada <ko1@atdot.net> * gc.c: is_incremental_marking(), will_be_incremental_marking(): diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index 820e22134a..e4d3b8d57a 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -508,4 +508,22 @@ class TestSuper < Test::Unit::TestCase end assert_equal("A", b.new.foo, bug10263) end + + def test_super_with_block + a = Class.new do + def foo + yield + end + end + + b = Class.new(a) do + def foo + super{ + "b" + } + end + end + + assert_equal "b", b.new.foo{"c"} + end end |