diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_super.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index 8494745fed..7208b362fc 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -322,4 +322,16 @@ class TestSuper < Test::Unit::TestCase obj.foo.call end end + + def test_yielding_super + a = Class.new { def yielder; yield; end } + x = Class.new { define_singleton_method(:hello) { 'hi' } } + y = Class.new(x) { + define_singleton_method(:hello) { + m = a.new + m.yielder { super() } + } + } + assert_equal 'hi', y.hello + end end |