class BlankTest

Constants

BLANK
NOT

Public Instance Methods

test_blank() click to toggle source
# File activesupport/test/core_ext/object/blank_test.rb, line 22
def test_blank
  BLANK.each { |v| assert_equal true, v.blank?,  "#{v.inspect} should be blank" }
  NOT.each   { |v| assert_equal false, v.blank?, "#{v.inspect} should not be blank" }
end
test_presence() click to toggle source
# File activesupport/test/core_ext/object/blank_test.rb, line 32
def test_presence
  BLANK.each { |v| assert_nil v.presence, "#{v.inspect}.presence should return nil" }
  NOT.each   { |v| assert_equal v,   v.presence, "#{v.inspect}.presence should return self" }
end
test_present() click to toggle source
# File activesupport/test/core_ext/object/blank_test.rb, line 27
def test_present
  BLANK.each { |v| assert_equal false, v.present?, "#{v.inspect} should not be present" }
  NOT.each   { |v| assert_equal true, v.present?,  "#{v.inspect} should be present" }
end