aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/blank_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-06-12 18:30:56 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-06-12 18:30:56 -0500
commita3caf28da3a22c1326d3d98dcf71483a8edaa55a (patch)
treeffdee041bedbc1d57eba9cd3dcd4b0879a305158 /activesupport/test/core_ext/blank_test.rb
parentea3a7e1bb1efc8b3ca10c4163bc116f3d5e23af1 (diff)
downloadrails-a3caf28da3a22c1326d3d98dcf71483a8edaa55a.tar.gz
rails-a3caf28da3a22c1326d3d98dcf71483a8edaa55a.tar.bz2
rails-a3caf28da3a22c1326d3d98dcf71483a8edaa55a.zip
Added Object#present? which is equivalent to !Object#blank? [DHH]
Diffstat (limited to 'activesupport/test/core_ext/blank_test.rb')
-rw-r--r--activesupport/test/core_ext/blank_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/blank_test.rb b/activesupport/test/core_ext/blank_test.rb
index 061d940383..00fea74639 100644
--- a/activesupport/test/core_ext/blank_test.rb
+++ b/activesupport/test/core_ext/blank_test.rb
@@ -16,4 +16,9 @@ class BlankTest < Test::Unit::TestCase
BLANK.each { |v| assert v.blank?, "#{v.inspect} should be blank" }
NOT.each { |v| assert !v.blank?, "#{v.inspect} should not be blank" }
end
+
+ def test_present
+ BLANK.each { |v| assert !v.present?, "#{v.inspect} should not be present" }
+ NOT.each { |v| assert v.present?, "#{v.inspect} should be present" }
+ end
end