aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-14 06:03:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-14 06:03:55 +0000
commit50a1097a4d97351541c1ef004720a8bd9c838d0a (patch)
tree110565def22ae843d9d1def090b4b436a5f52f45 /test
parent3d19e6c8da289e742ea9a6cd0bb20ff468380e75 (diff)
downloadruby-50a1097a4d97351541c1ef004720a8bd9c838d0a.tar.gz
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_method.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 83ad484238..9722e1b1a4 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -901,6 +901,17 @@ class TestMethod < Test::Unit::TestCase
assert_nil(m)
end
+ def test_super_method_with_prepended_module
+ bug = '[ruby-core:81666] [Bug #13656]'
+ c1 = EnvUtil.labeled_class("C1") {def m; end}
+ c2 = EnvUtil.labeled_class("C2", c1) {def m; end}
+ c2.prepend(EnvUtil.labeled_module("M"))
+ m = c2.instance_method(:m)
+ assert_equal(c2, m.owner)
+ m = m.super_method
+ assert_equal(c1, m.owner, bug)
+ end
+
def rest_parameter(*rest)
rest
end