aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/test/core_ext/blank_test.rb
blob: ff7345e774c61e4322262fe16c07f610b705fe4e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
                   
                                                                            










                                                                           
require 'test/unit'
require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/object'
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