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 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 |