aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/assertions.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2013-01-05 09:07:56 -0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2013-01-05 09:07:56 -0800
commitcbabd1bf246913ceeb2f7435c1baa9160b17339e (patch)
tree5314a890679253e9201a2282daa88a32a13a0809 /activesupport/lib/active_support/testing/assertions.rb
parent3d08614826e18e005818c7685b9bc4cdc28f77af (diff)
parent947e1d5e85fa87128b7c5e21da55b92826cd7801 (diff)
downloadrails-cbabd1bf246913ceeb2f7435c1baa9160b17339e.tar.gz
rails-cbabd1bf246913ceeb2f7435c1baa9160b17339e.tar.bz2
rails-cbabd1bf246913ceeb2f7435c1baa9160b17339e.zip
Merge pull request #8769 from senny/deprecate_assert_blank
deprecate `assert_blank` and `assert_present`.
Diffstat (limited to 'activesupport/lib/active_support/testing/assertions.rb')
-rw-r--r--activesupport/lib/active_support/testing/assertions.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/testing/assertions.rb b/activesupport/lib/active_support/testing/assertions.rb
index 88aebba5c5..175f7ffe5a 100644
--- a/activesupport/lib/active_support/testing/assertions.rb
+++ b/activesupport/lib/active_support/testing/assertions.rb
@@ -103,6 +103,7 @@ module ActiveSupport
#
# assert_blank [], 'this should be blank'
def assert_blank(object, message=nil)
+ ActiveSupport::Deprecation.warn('"assert_blank" is deprecated. Please use "assert object.blank?" instead')
message ||= "#{object.inspect} is not blank"
assert object.blank?, message
end
@@ -117,6 +118,7 @@ module ActiveSupport
#
# assert_present({ data: 'x' }, 'this should not be blank')
def assert_present(object, message=nil)
+ ActiveSupport::Deprecation.warn('"assert_present" is deprecated. Please use "assert object.present?" instead')
message ||= "#{object.inspect} is blank"
assert object.present?, message
end