From 947e1d5e85fa87128b7c5e21da55b92826cd7801 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Sat, 5 Jan 2013 17:59:36 +0100 Subject: deprecate `assert_blank` and `assert_present`. They don't add any benefits over `assert object.blank?` and `assert object.present?` --- activesupport/lib/active_support/testing/assertions.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activesupport/lib/active_support') 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 -- cgit v1.2.3