Skip to content

Commit

Permalink
make sure missing method does not fail with arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
dmathieu committed May 21, 2011
1 parent 29a5aea commit a85e00c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions activesupport/test/core_ext/object_and_class_ext_test.rb
Expand Up @@ -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)
Expand Down

0 comments on commit a85e00c

Please sign in to comment.