public
Description: My assistance repo w/ minor tweaks (original @ http://assistance.rubyforge.org/svn/trunk)
Homepage: http://assistance.rubyforge.org
Clone URL: git://github.com/bricooke/assistance.git
assistance / spec / blank_spec.rb
100644 9 lines (7 sloc) 0.31 kb
1
2
3
4
5
6
7
8
9
require File.join(File.dirname(__FILE__), 'spec_helper')
 
describe "blank?" do
  it "should mark empty objects as blank" do
    [ nil, false, '', ' ', " \n\t \r ", [], {} ].each { |f| f.should be_blank }
    [ Object.new, true, 0, 1, 'a', [nil], { nil => 0 } ].each { |t| t.should_not be_blank }
  end
end