aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object/try_test.rb
diff options
context:
space:
mode:
authorDaniel Colson <danieljamescolson@gmail.com>2018-01-24 21:14:10 -0500
committerDaniel Colson <danieljamescolson@gmail.com>2018-01-25 23:32:58 -0500
commit0d50cae996c51630361e8514e1f168b0c48957e1 (patch)
treedfbf9609ff6f3d859e584874ac6d8bdc91304c08 /activesupport/test/core_ext/object/try_test.rb
parent8baca31dbe522cb407f0b3b8c8d3d4a6804e5aed (diff)
downloadrails-0d50cae996c51630361e8514e1f168b0c48957e1.tar.gz
rails-0d50cae996c51630361e8514e1f168b0c48957e1.tar.bz2
rails-0d50cae996c51630361e8514e1f168b0c48957e1.zip
Use respond_to test helpers
Diffstat (limited to 'activesupport/test/core_ext/object/try_test.rb')
-rw-r--r--activesupport/test/core_ext/object/try_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/test/core_ext/object/try_test.rb b/activesupport/test/core_ext/object/try_test.rb
index fe68b24bf5..40d6cdd28e 100644
--- a/activesupport/test/core_ext/object/try_test.rb
+++ b/activesupport/test/core_ext/object/try_test.rb
@@ -10,25 +10,25 @@ class ObjectTryTest < ActiveSupport::TestCase
def test_nonexisting_method
method = :undefined_method
- assert !@string.respond_to?(method)
+ assert_not_respond_to @string, method
assert_nil @string.try(method)
end
def test_nonexisting_method_with_arguments
method = :undefined_method
- assert !@string.respond_to?(method)
+ assert_not_respond_to @string, method
assert_nil @string.try(method, "llo", "y")
end
def test_nonexisting_method_bang
method = :undefined_method
- assert !@string.respond_to?(method)
+ assert_not_respond_to @string, method
assert_raise(NoMethodError) { @string.try!(method) }
end
def test_nonexisting_method_with_arguments_bang
method = :undefined_method
- assert !@string.respond_to?(method)
+ assert_not_respond_to @string, method
assert_raise(NoMethodError) { @string.try!(method, "llo", "y") }
end