aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/CHANGELOG.md11
-rw-r--r--activesupport/lib/active_support/test_case.rb6
2 files changed, 15 insertions, 2 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index db8d279cff..2a5d203813 100644
--- a/activesupport/CHANGELOG.md
+++ b/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*
@@ -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.
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb
index 221e1171e7..2d2e25c970 100644
--- a/activesupport/lib/active_support/test_case.rb
+++ b/activesupport/lib/active_support/test_case.rb
@@ -74,7 +74,11 @@ module ActiveSupport
# 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