diff options
Diffstat (limited to 'test/ruby/test_object.rb')
-rw-r--r-- | test/ruby/test_object.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index d33b9f6341..3705df21c1 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -420,6 +420,20 @@ class TestObject < Test::Unit::TestCase assert_equal([[:respond_to?, :to_ary, true]], called, bug5158) end + def test_implicit_respond_to_arity_1 + p = Object.new + + called = [] + p.singleton_class.class_eval do + define_method(:respond_to?) do |a| + called << [:respond_to?, a] + false + end + end + [[p]].flatten + assert_equal([[:respond_to?, :to_ary]], called, '[bug:6000]') + end + def test_method_missing_passed_block bug5731 = '[ruby-dev:44961]' |