diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-01-05 17:59:36 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-01-05 18:04:52 +0100 |
commit | 947e1d5e85fa87128b7c5e21da55b92826cd7801 (patch) | |
tree | 5d86ab00506c39d154226f177cce36245d2fd440 /activesupport/lib | |
parent | fada87e916dd50eb6766cac919de41f0be2a12bc (diff) | |
download | rails-947e1d5e85fa87128b7c5e21da55b92826cd7801.tar.gz rails-947e1d5e85fa87128b7c5e21da55b92826cd7801.tar.bz2 rails-947e1d5e85fa87128b7c5e21da55b92826cd7801.zip |
deprecate `assert_blank` and `assert_present`.
They don't add any benefits over `assert object.blank?`
and `assert object.present?`
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/testing/assertions.rb | 2 |
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 |