Skip to content

Commit

Permalink
add deprecation warning to assert_nothing_raised and changelog entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Tara Scherner de la Fuente committed Feb 23, 2016
1 parent 640ef22 commit d96550b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion activesupport/CHANGELOG.md
@@ -1,3 +1,12 @@
* 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*
Expand All @@ -6,7 +15,7 @@

`#on_weekday?` returns `true` if the receiving date/time does not fall on a Saturday
or Sunday.

*Vipul A M*

* Add `Array#second_to_last` and `Array#third_to_last` methods.
Expand Down
6 changes: 5 additions & 1 deletion activesupport/lib/active_support/test_case.rb
Expand Up @@ -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
Expand Down

0 comments on commit d96550b

Please sign in to comment.