Sha256: 32e6edabb34ac8ca2c17332eea1eaded9ad3a3bdaac1113cc3a48aadf0aff781

Contents?: true

Size: 555 Bytes

Versions: 6

Compression:

Stored size: 555 Bytes

Contents

require 'helper'

[
  { :object => nil, :description => :nil },
  { :object => [], :description => 'Empty array' },
  { :object => {}, :description => 'Empty hash' },
  { :object => '', :description => 'Empty string' },
  { :object => ' ', :description => 'Whitespace string' },
  { :object => false, :description => :false }
].each do |item|

  describe item[:description] do
    it "should be blank?" do
      item[:object].blank?.should == true
    end

    it "should not be present?" do
      item[:object].present?.should == false
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
upoj-rb-0.0.5 spec/blank_spec.rb
upoj-rb-0.0.4 spec/blank_spec.rb
upoj-rb-0.0.3 spec/blank_spec.rb
upoj-rb-0.0.2 spec/blank_spec.rb
upoj-rb-0.0.1 spec/blank_spec.rb
upoj-rb-0.0.0 spec/blank_spec.rb