From d40ef8a85c271c3570e778fb74f53d6401281a9d Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 13 Feb 2013 09:10:12 +0000 Subject: proc.c: show the given name * proc.c (method_inspect): show the given name primarily, and original_id if aliased. [ruby-core:52048] [Bug #7806] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_method.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index 03d7cab2d7..2ef37c4af6 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -189,6 +189,11 @@ class TestMethod < Test::Unit::TestCase assert_equal(class << o; self; end, m.owner) assert_equal(:foo, m.unbind.name) assert_equal(class << o; self; end, m.unbind.owner) + class << o + alias bar foo + end + m = o.method(:bar) + assert_equal(:bar, m.name) end def test_instance_method @@ -311,6 +316,12 @@ class TestMethod < Test::Unit::TestCase c2.class_eval { private :foo } m2 = c2.new.method(:foo) assert_equal("#", m2.inspect) + + bug7806 = '[ruby-core:52048] [Bug #7806]' + c3 = Class.new(c) + c3.class_eval { alias bar foo } + m3 = c3.new.method(:bar) + assert_equal("#", m3.inspect, bug7806) end def test_callee_top_level -- cgit v1.2.3