Sha256: a2ba8e1d6a0140a5e82bebdbd2e55e5c5de7961f4be90584e9fc6f5fe6295484
Contents?: true
Size: 486 Bytes
Versions: 2
Compression:
Stored size: 486 Bytes
Contents
require 'abstract_unit' class EmptyTrue def empty?() true; end end class EmptyFalse def empty?() false; end end class BlankTest < Test::Unit::TestCase BLANK = [ EmptyTrue.new, nil, false, '', ' ', " \n\t \r ", [], {} ] NOT = [ EmptyFalse.new, Object.new, true, 0, 1, 'a', [nil], { nil => 0 } ] def test_blank BLANK.each { |v| assert v.blank?, "#{v.inspect} should be blank" } NOT.each { |v| assert !v.blank?, "#{v.inspect} should not be blank" } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
antfarm-0.3.0 | rails/vendor/rails/activesupport/test/core_ext/blank_test.rb |
antfarm-0.4.0 | rails/vendor/rails/activesupport/test/core_ext/blank_test.rb |