diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-22 16:51:08 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-22 16:51:08 +0000 |
commit | 51a41dd0569b27b80342aa4bd72e6b2c9f2c482c (patch) | |
tree | d044040850385a4247470e240d5357bf92e66939 /test/ruby/test_super.rb | |
parent | c06924693158a17bad63f0f343c6e951d9b9b8eb (diff) | |
download | ruby-51a41dd0569b27b80342aa4bd72e6b2c9f2c482c.tar.gz |
* insns.def: search up the cf stack for an object that is an instance
of the recipient class. Fixes [ruby-core:47186]
* test/ruby/test_super.rb: related test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_super.rb')
-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 |