aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_method.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_method.rb')
-rw-r--r--test/ruby/test_method.rb11
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