add deprecation warning to assert_nothing_raised and changelog entry

上级 640ef22b
* Deprecate arguments on `assert_nothing_raised`.
`assert_nothing_raised` does not assert the arguments that have been passed
in (usually a specific exception class) since the method only yields the
block. So as not to confuse the users that the arguments have meaning, they
are being deprecated.
*Tara Scherner de la Fuente*
* Make `benchmark('something', silence: true)` actually work
*DHH*
......
......@@ -74,7 +74,11 @@ def test_order
# assert_nothing_raised do
# perform_service(param: 'no_exception')
# end
def assert_nothing_raised
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
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册