summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-23 07:02:29 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-23 07:02:29 +0000
commitc358595ae42e1b5ed4647dd017d91cf3aa480740 (patch)
tree7aeecfce98169ba92ca319140d4d794c0a052e7c /test
parentf03997d328c2a536ad4b6c5a262ad1345570288f (diff)
merge revision(s) 59080,59082: [Backport #13656]
proc.c: skip prepended modules * proc.c (method_super_method): skip prepended modules and continue from the super class of the original class. [ruby-core:81666] [Bug #13656] test/ruby/test_method.rb: refined [ruby-core:81666] [Bug #13656] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_method.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 83ad484238..1f8b86acdc 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -901,6 +901,18 @@ class TestMethod < Test::Unit::TestCase
assert_nil(m)
end
+ def test_super_method_with_prepended_module
+ bug = '[ruby-core:81666] [Bug #13656] should be the method of the parent'
+ c1 = EnvUtil.labeled_class("C1") {def m; end}
+ c2 = EnvUtil.labeled_class("C2", c1) {def m; end}
+ c2.prepend(EnvUtil.labeled_module("M"))
+ m1 = c1.instance_method(:m)
+ m2 = c2.instance_method(:m).super_method
+ assert_equal(m1, m2, bug)
+ assert_equal(c1, m2.owner, bug)
+ assert_equal(m1.source_location, m2.source_location, bug)
+ end
+
def rest_parameter(*rest)
rest
end