From b83d68a38fcc4d1e499bc7c52a96499fbecb0681 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 14 Dec 2013 04:02:00 +0000 Subject: 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 --- 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 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 -- cgit v1.2.3