lib/core/facets/string/blank.rb in facets-2.1.3 vs lib/core/facets/string/blank.rb in facets-2.2.0

- old
+ new

@@ -1,60 +1,16 @@ -# TITLE: -# -# String Blank Extension -# -# SUMMARY: -# -# String blank extensions. -# -# CREDIT: -# -# - Martin Pool -# - Alan Davies -# - Derek Lewis -# - Peter Vanbroekhoven -# -# TODO: -# -# - Does #blank? really belong here? - -# class String # Is this string just whitespace? # # "abc".blank? #=> false # " ".blank? #=> true + # + # CREDIT: ? def blank? self !~ /\S/ end alias whitespace? blank? end - - -# _____ _ -# |_ _|__ ___| |_ -# | |/ _ \/ __| __| -# | | __/\__ \ |_ -# |_|\___||___/\__| -# -=begin test - - require 'test/unit' - - class TestStringBlank < Test::Unit::TestCase - - def test_blank? - assert( ! "xyz".blank? ) - assert( " ".blank? ) - end - - def test_whitespace? - assert( ! "xyz".whitespace? ) - assert( " ".whitespace? ) - end - end - -=end