diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-28 02:23:11 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-28 02:23:11 +0000 |
commit | d5a39c0aa85a705fcf360a535a278aed9116f644 (patch) | |
tree | 8aef34e37c0e99aac218b6984082339f38f991e5 /test/ruby | |
parent | bab92f0fea521263964115339b7f395c38400ab0 (diff) | |
download | ruby-d5a39c0aa85a705fcf360a535a278aed9116f644.tar.gz |
* proc.c (method_eq): fix the documentation to refer to owner.
[ruby-core:51105] [Bug #7613]
* test/ruby/test_method.rb (test_alias_onwer): new test to confirm
that `a == b' returns false if owners of a and b are different.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_method.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index c8f55e20e5..03d7cab2d7 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -507,4 +507,19 @@ class TestMethod < Test::Unit::TestCase assert_instance_of String, __dir__ assert_equal(File.dirname(__FILE__), __dir__) end + + def test_alias_owner + bug7613 = '[ruby-core:51105]' + c = Class.new { + def foo + end + } + x = c.new + class << x + alias bar foo + end + assert_equal(c, x.method(:foo).owner) + assert_equal(x.singleton_class, x.method(:bar).owner) + assert(x.method(:foo) != x.method(:bar), bug7613) + end end |