Sha256: deddf5165d4d5bb2b3d9b6265a3efe8730005693c381a5258a0d07d89e7c4907

Contents?: true

Size: 795 Bytes

Versions: 24

Compression:

Stored size: 795 Bytes

Contents

require 'spec_helper'
require 'sugar-high/blank'

describe "SugarHigh" do
  describe "Blank ext" do
    describe '#blank' do    
      it "nil and empty string should be blank" do
        nil.blank?.should be_true
        ''.blank?.should be_true
      end
    end
    
    describe '#wblank' do    
      it "nil and empty string should be blank" do
        nil.wblank?.should be_true
        '  '.wblank?.should be_true
      end
    end

    describe '#empty' do    
      it "nil and empty string should be empty" do
        nil.empty?.should be_true
        ''.empty?.should be_true
      end

      context 'Array' do
        it "nil and empty array should not have any" do
          nil.any?.should be_false
          [].any?.should be_false
        end
      end      
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
sugar-high-0.3.7 spec/sugar-high/blank_spec.rb
sugar-high-0.3.6 spec/sugar-high/blank_spec.rb
sugar-high-0.3.5 spec/sugar-high/blank_spec.rb
sugar-high-0.3.4 spec/sugar-high/blank_spec.rb
sugar-high-0.3.3 spec/sugar-high/blank_spec.rb
sugar-high-0.3.2 spec/sugar-high/blank_spec.rb
sugar-high-0.3.1 spec/sugar-high/blank_spec.rb
sugar-high-0.3.0 spec/sugar-high/blank_spec.rb
sugar-high-0.2.12 spec/sugar-high/blank_spec.rb
sugar-high-0.2.11 spec/sugar-high/blank_spec.rb
sugar-high-0.2.10 spec/sugar-high/blank_spec.rb
sugar-high-0.2.9 spec/sugar-high/blank_spec.rb
sugar-high-0.2.8 spec/sugar-high/blank_spec.rb
sugar-high-0.2.7 spec/sugar-high/blank_spec.rb
sugar-high-0.2.6 spec/sugar-high/blank_spec.rb
sugar-high-0.2.5 spec/sugar-high/blank_spec.rb
sugar-high-0.2.4 spec/sugar-high/blank_spec.rb
sugar-high-0.2.2 spec/sugar-high/blank_spec.rb
sugar-high-0.2.1 spec/sugar-high/blank_spec.rb
sugar-high-0.2.0 spec/sugar-high/blank_spec.rb