aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordmathieu <42@dmathieu.com>2011-05-22 00:32:58 +0200
committerdmathieu <42@dmathieu.com>2011-05-22 00:32:58 +0200
commita85e00c01c5b9f5592113371c0da5e389129f3f1 (patch)
treee751acb2eab3b97773298dbe8eece95569fd8351
parent29a5aeaae976bf8432d57ec996c7c81932a39de6 (diff)
downloadrails-a85e00c01c5b9f5592113371c0da5e389129f3f1.tar.gz
rails-a85e00c01c5b9f5592113371c0da5e389129f3f1.tar.bz2
rails-a85e00c01c5b9f5592113371c0da5e389129f3f1.zip
make sure missing method does not fail with arguments
-rw-r--r--activesupport/test/core_ext/object_and_class_ext_test.rb6
1 files changed, 6 insertions, 0 deletions
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)