Permalink
Browse files

make sure missing method does not fail with arguments

  • Loading branch information...
1 parent 29a5aea commit a85e00c01c5b9f5592113371c0da5e389129f3f1 @dmathieu dmathieu committed May 21, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 activesupport/test/core_ext/object_and_class_ext_test.rb
@@ -101,6 +101,12 @@ def test_nonexisting_method
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)

0 comments on commit a85e00c

Please sign in to comment.