instance method
assert_nothing_raised
Ruby on Rails 5.0.7.2
Since v4.0.13 Last seen in v5.0.7.2Signature
assert_nothing_raised(*args)
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
Parameters
-
argsrest
Source
# File activesupport/lib/active_support/test_case.rb, line 77
def assert_nothing_raised(*args)
if args.present?
ActiveSupport::Deprecation.warn(
"Passing arguments to assert_nothing_raised " \
"is deprecated and will be removed in Rails 5.1.")
end
yield
end
Defined in activesupport/lib/active_support/test_case.rb line 77
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::TestCase