From a85e00c01c5b9f5592113371c0da5e389129f3f1 Mon Sep 17 00:00:00 2001 From: dmathieu <42@dmathieu.com> Date: Sun, 22 May 2011 00:32:58 +0200 Subject: [PATCH] make sure missing method does not fail with arguments --- activesupport/test/core_ext/object_and_class_ext_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) 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)