diff --git a/activesupport/test/core_ext/object_and_class_ext_test.rb b/activesupport/test/core_ext/object_and_class_ext_test.rb index 108010a614..beb371d987 100644 --- a/activesupport/test/core_ext/object_and_class_ext_test.rb +++ b/activesupport/test/core_ext/object_and_class_ext_test.rb @@ -101,6 +101,12 @@ class ObjectTryTest < Test::Unit::TestCase assert !@string.respond_to?(method) assert_nil @string.try(method) end + + def test_nonexisting_method_with_arguments + method = :undefined_method + assert !@string.respond_to?(method) + assert_nil @string.try(method, 'llo', 'y') + end def test_valid_method assert_equal 5, @string.try(:size)