From 3be6ebc5ce37dc5f3800484d525e501f66d51d8e Mon Sep 17 00:00:00 2001 From: kazu Date: Tue, 15 Apr 2008 10:07:59 +0000 Subject: * eval.c (method_receiver, method_name, method_owner): New methods; backported from 1.9. bug#19007 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_method.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index c30705cb15..b22c2cba62 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -39,4 +39,13 @@ class TestMethod < Test::Unit::TestCase um.bind(Base.new) end end + + def test_receiver_name_owner + o = Object.new + def o.foo; end + m = o.method(:foo) + assert_equal(o, m.receiver) + assert_equal("foo", m.name) + assert_equal(class << o; self; end, m.owner) + end end -- cgit v1.2.3