aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object/try_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/object/try_test.rb')
-rw-r--r--activesupport/test/core_ext/object/try_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/test/core_ext/object/try_test.rb b/activesupport/test/core_ext/object/try_test.rb
index efc6beaf02..89438675c1 100644
--- a/activesupport/test/core_ext/object/try_test.rb
+++ b/activesupport/test/core_ext/object/try_test.rb
@@ -52,11 +52,11 @@ class ObjectTryTest < ActiveSupport::TestCase
end
def test_try_only_block
- assert_equal @string.reverse, @string.try { |s| s.reverse }
+ assert_equal @string.reverse, @string.try(&:reverse)
end
def test_try_only_block_bang
- assert_equal @string.reverse, @string.try! { |s| s.reverse }
+ assert_equal @string.reverse, @string.try!(&:reverse)
end
def test_try_only_block_nil