Sha256: fa5ffa4fa7c8a38922338563deb06aed3229f6661b7d5a9b10568d5cb8096d7f

Contents?: true

Size: 438 Bytes

Versions: 7

Compression:

Stored size: 438 Bytes

Contents

require 'spec_helper'

describe Array do

  it 'should compact blank objects and leave non-blank objects in place' do
    [0, 1, 2, 3].compakt.should == [0, 1, 2, 3]
    [0, '', :symbol].compakt.should == [0, :symbol]
    [[], [1, 2]].compakt.should == [[1, 2]]
    [{ :stuff => :junk }, {}, 'stuff'].compakt.should == [{ :stuff => :junk }, 'stuff']
    ['      ', ' I need trimming! '].compakt.should == [' I need trimming! ']
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bootstripe-0.2.8 spec/array_additions_spec.rb
bootstripe-0.2.7 spec/array_additions_spec.rb
bootstripe-0.2.6 spec/array_additions_spec.rb
bootstripe-0.2.5 spec/array_additions_spec.rb
bootstripe-0.2.4 spec/array_additions_spec.rb
bootstripe-0.2.3 spec/array_additions_spec.rb
bootstripe-0.2.2 spec/array_additions_spec.rb