Sha256: 5951d535e5ca519047e3c153e41a41a06aa9556289dda504e2bb60158df321ad

Contents?: true

Size: 532 Bytes

Versions: 6

Compression:

Stored size: 532 Bytes

Contents

require 'helper'

describe "Hash.from_store" do
  it "should convert hash to hash with indifferent access" do
    hash = Hash.from_store(:foo => 'bar')
    hash[:foo].should  == 'bar'
    hash['foo'].should == 'bar'
  end

  it "should be hash if nil" do
    hash = Hash.from_store(nil)
    hash.should == {}
    hash.is_a?(HashWithIndifferentAccess).should be_true
  end
end

describe "Hash.store_default" do
  it "returns emtpy hash with indifferent access" do
    Hash.store_default.should == {}.with_indifferent_access
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
toystore-0.6.4 spec/toy/extensions/hash_spec.rb
toystore-0.6.3 spec/toy/extensions/hash_spec.rb
toystore-0.6.2 spec/toy/extensions/hash_spec.rb
toystore-0.6.1 spec/toy/extensions/hash_spec.rb
toystore-0.6 spec/toy/extensions/hash_spec.rb
toystore-0.5 spec/toy/extensions/hash_spec.rb