diff options
author | dmathieu <42@dmathieu.com> | 2011-05-22 00:32:58 +0200 |
---|---|---|
committer | dmathieu <42@dmathieu.com> | 2011-05-22 00:32:58 +0200 |
commit | a85e00c01c5b9f5592113371c0da5e389129f3f1 (patch) | |
tree | e751acb2eab3b97773298dbe8eece95569fd8351 /activesupport | |
parent | 29a5aeaae976bf8432d57ec996c7c81932a39de6 (diff) | |
download | rails-a85e00c01c5b9f5592113371c0da5e389129f3f1.tar.gz rails-a85e00c01c5b9f5592113371c0da5e389129f3f1.tar.bz2 rails-a85e00c01c5b9f5592113371c0da5e389129f3f1.zip |
make sure missing method does not fail with arguments
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/core_ext/object_and_class_ext_test.rb | 6 |
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) |