diff options
author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-15 10:07:59 +0000 |
---|---|---|
committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-15 10:07:59 +0000 |
commit | 3be6ebc5ce37dc5f3800484d525e501f66d51d8e (patch) | |
tree | 79b09fa0a7ef993f7dfd7afcc22c3cb8b9194144 /test/ruby | |
parent | e04e2e0bb33e48f556037d786db60ac2059b2af9 (diff) |
* 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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_method.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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 |