Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test try! with a block

  • Loading branch information...
commit 36ff09d7da72dbb4b55229cbf76b3b316775625f 1 parent ce0f977
@amatsuda amatsuda authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 activesupport/test/core_ext/object_and_class_ext_test.rb
View
4 activesupport/test/core_ext/object_and_class_ext_test.rb
@@ -120,6 +120,10 @@ def test_nonexisting_method_with_arguments_bang
assert_raise(NoMethodError) { @string.try!(method, 'llo', 'y') }
end
+ def test_try_only_block_bang
+ assert_equal @string.reverse, @string.try! { |s| s.reverse }
+ end
+
def test_valid_method
assert_equal 5, @string.try(:size)
end
Please sign in to comment.
Something went wrong with that request. Please try again.