aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/blank_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/blank_test.rb')
-rw-r--r--activesupport/test/core_ext/blank_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/blank_test.rb b/activesupport/test/core_ext/blank_test.rb
new file mode 100644
index 0000000000..2aba73a008
--- /dev/null
+++ b/activesupport/test/core_ext/blank_test.rb
@@ -0,0 +1,13 @@
+require 'test/unit'
+require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/object_and_class'
+require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/blank'
+
+class BlankTest < Test::Unit::TestCase
+ BLANK = [nil, false, '', ' ', " \n\t \r ", [], {}]
+ NOT = [true, 0, 1, 'a', [nil], { nil => 0 }]
+
+ def test_blank
+ BLANK.each { |v| assert v.blank? }
+ NOT.each { |v| assert !v.blank? }
+ end
+end