summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-20 15:53:38 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-20 15:53:38 +0000
commit9e7b5784180e29b258c99fd36639b5221d427287 (patch)
treee055f4d1e6d183fd14d11d20fd49bd3ce17f09f5 /test
parentab2e7357bd27b5139415bf823c2780bc8273eb83 (diff)
merge revision(s) 58245,60127: [Backport #13973]
Refactored using Method#owner. proc.c: super_method of included method * proc.c (method_super_method): search the next super method along the included ancestor chain. [ruby-core:83114] [Bug #13973] * vm_method.c (rb_callable_method_entry_without_refinements): return the defined class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_method.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 1f8b86acdc..7f173e86ac 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -873,6 +873,16 @@ class TestMethod < Test::Unit::TestCase
m = m.super_method
assert_equal(c1, m.owner, Feature9781)
assert_same(o, m.receiver, Feature9781)
+
+ c1 = Class.new {def foo; end}
+ c2 = Class.new(c1) {include m1; include m2}
+ m = c2.instance_method(:foo)
+ assert_equal(m2, m.owner)
+ m = m.super_method
+ assert_equal(m1, m.owner)
+ m = m.super_method
+ assert_equal(c1, m.owner)
+ assert_nil(m.super_method)
end
def test_super_method_removed