Permalink
Browse files

Merge pull request #26293 from mechanicles/move-custom-assertion

Move Rails' custom assertion method `assert_nothing_raised` to its proper place.
  • Loading branch information...
guilleiguaran committed Aug 27, 2016
2 parents 1ec85cf + 3cece0b commit 29f097c53876411a6d468060de318814c9b89291
@@ -65,16 +65,5 @@ def test_order
alias :assert_not_predicate :refute_predicate
alias :assert_not_respond_to :refute_respond_to
alias :assert_not_same :refute_same
# Assertion that the block should not raise an exception.
#
# Passes if evaluated code in the yielded block raises no exception.
#
# assert_nothing_raised do
# perform_service(param: 'no_exception')
# end
def assert_nothing_raised
yield
end
end
end
@@ -19,6 +19,17 @@ def assert_not(object, message = nil)
assert !object, message
end
# Assertion that the block should not raise an exception.
#
# Passes if evaluated code in the yielded block raises no exception.
#
# assert_nothing_raised do
# perform_service(param: 'no_exception')
# end
def assert_nothing_raised
yield
end
# Test numeric difference between the return value of an expression as a
# result of what is evaluated in the yielded block.
#

0 comments on commit 29f097c

Please sign in to comment.