diff options
Diffstat (limited to 'test')
-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 a81d6d3812..45268ed779 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -180,6 +180,15 @@ class TestMethod < Test::Unit::TestCase assert_equal(Array.instance_method(:map).hash, Array.instance_method(:collect).hash) end + def test_owner + c = Class.new do + def foo; end + end + assert_equal(c, c.instance_method(:foo).owner) + c2 = Class.new(c) + assert_equal(c, c2.instance_method(:foo).owner) + end + def test_receiver_name_owner o = Object.new def o.foo; end |