mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby/test_method.rb: refined [ruby-core:81666] [Bug #13656]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9eb92007b6
commit
452f46b751
1 changed files with 6 additions and 5 deletions
|
@ -902,14 +902,15 @@ class TestMethod < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_super_method_with_prepended_module
|
def test_super_method_with_prepended_module
|
||||||
bug = '[ruby-core:81666] [Bug #13656]'
|
bug = '[ruby-core:81666] [Bug #13656] should be the method of the parent'
|
||||||
c1 = EnvUtil.labeled_class("C1") {def m; end}
|
c1 = EnvUtil.labeled_class("C1") {def m; end}
|
||||||
c2 = EnvUtil.labeled_class("C2", c1) {def m; end}
|
c2 = EnvUtil.labeled_class("C2", c1) {def m; end}
|
||||||
c2.prepend(EnvUtil.labeled_module("M"))
|
c2.prepend(EnvUtil.labeled_module("M"))
|
||||||
m = c2.instance_method(:m)
|
m1 = c1.instance_method(:m)
|
||||||
assert_equal(c2, m.owner)
|
m2 = c2.instance_method(:m).super_method
|
||||||
m = m.super_method
|
assert_equal(m1, m2, bug)
|
||||||
assert_equal(c1, m.owner, bug)
|
assert_equal(c1, m2.owner, bug)
|
||||||
|
assert_equal(m1.source_location, m2.source_location, bug)
|
||||||
end
|
end
|
||||||
|
|
||||||
def rest_parameter(*rest)
|
def rest_parameter(*rest)
|
||||||
|
|
Loading…
Add table
Reference in a new issue