aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing
diff options
context:
space:
mode:
authorJuanjo Bazan <jjbazan@gmail.com>2010-03-30 23:18:44 +0200
committerXavier Noria <fxn@hashref.com>2010-03-30 15:25:38 -0700
commit7212c29802e34fe7368d5b484a479c31fad49c5d (patch)
treea87c73b2ce0ae98efe7e1453d6e24671f388bb88 /activesupport/lib/active_support/testing
parent772a0226fdbedcc16432e1fb42552678f282e973 (diff)
downloadrails-7212c29802e34fe7368d5b484a479c31fad49c5d.tar.gz
rails-7212c29802e34fe7368d5b484a479c31fad49c5d.tar.bz2
rails-7212c29802e34fe7368d5b484a479c31fad49c5d.zip
new assertion: assert_blank
Signed-off-by: Xavier Noria <fxn@hashref.com>
Diffstat (limited to 'activesupport/lib/active_support/testing')
-rw-r--r--activesupport/lib/active_support/testing/assertions.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/testing/assertions.rb b/activesupport/lib/active_support/testing/assertions.rb
index c529b92240..30a22fcc0e 100644
--- a/activesupport/lib/active_support/testing/assertions.rb
+++ b/activesupport/lib/active_support/testing/assertions.rb
@@ -62,6 +62,13 @@ module ActiveSupport
def assert_no_difference(expression, message = nil, &block)
assert_difference expression, 0, message, &block
end
+
+ # Test if an expression is blank. Passes if object.blank? is true.
+ #
+ # assert_blank [] # => true
+ def assert_blank(object)
+ assert object.blank?, "#{object.inspect} is not blank"
+ end
end
end
end