From a15028bc38a6d2492803780acb7b55456a30051d Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 6 Oct 2017 05:55:11 +0000 Subject: 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/trunk@60127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_method.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index 6e201911f9..ce67aada2b 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -876,6 +876,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 -- cgit v1.2.3