Sha256: e8051a0e8f51b6b15d94f9f98c8668bfea170b2812bbb47c2ed257d8caebe0aa

Contents?: true

Size: 358 Bytes

Versions: 1

Compression:

Stored size: 358 Bytes

Contents

require 'spec_helper'
require 'core_ext/hash/compact'

describe Hash, 'extensions' do
  it 'compact' do
    hash     = { :a => :b, :c => nil }
    expected = { :a => :b }

    hash.compact.should == expected
  end

  it 'compact!' do
    hash     = { :a => :b, :c => nil }
    expected = { :a => :b }

    hash.compact!
    hash.should == expected
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
travis-core-0.0.1 spec/lib/core_ext/hash_spec.rb