diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-14 04:02:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-14 04:02:00 +0000 |
commit | b83d68a38fcc4d1e499bc7c52a96499fbecb0681 (patch) | |
tree | 4ec648be5d68de6b4c21e6e9099287ed097a47af /test/ruby/test_method.rb | |
parent | a370556cd289ee8bffaca769328c3d0de0928af2 (diff) |
proc.c: method by respond_to_missing?
* proc.c (mnew_from_me): method by respond_to_missing? should be
owned by the original class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_method.rb')
-rw-r--r-- | test/ruby/test_method.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index 45268ed779..2fde505183 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -189,6 +189,17 @@ class TestMethod < Test::Unit::TestCase assert_equal(c, c2.instance_method(:foo).owner) end + def test_owner_missing + c = Class.new do + def respond_to_missing?(name, bool) + name == :foo + end + end + c2 = Class.new(c) + assert_equal(c, c.new.method(:foo).owner) + assert_equal(c2, c2.new.method(:foo).owner) + end + def test_receiver_name_owner o = Object.new def o.foo; end |