Sha256: f7cf77d78d8cb17b6c464bf227d60b545eeb4f68f3abbafaa5ec15cc6fc4bac5

Contents?: true

Size: 736 Bytes

Versions: 26

Compression:

Stored size: 736 Bytes

Contents

require 'spec_helper'

describe Hash do
  it "should be convertible to a Hashie::Mash" do
    mash = Hashie::Hash[:some => "hash"].to_mash
    mash.is_a?(Hashie::Mash).should be_true
    mash.some.should == "hash"
  end
  
  it "#stringify_keys! should turn all keys into strings" do
    hash = Hashie::Hash[:a => "hey", 123 => "bob"]
    hash.stringify_keys!
    hash.should == Hashie::Hash["a" => "hey", "123" => "bob"]
  end
  
  it "#stringify_keys should return a hash with stringified keys" do
    hash = Hashie::Hash[:a => "hey", 123 => "bob"]
    stringified_hash = hash.stringify_keys
    hash.should == Hashie::Hash[:a => "hey", 123 => "bob"]
    stringified_hash.should == Hashie::Hash["a" => "hey", "123" => "bob"]
  end
end

Version data entries

26 entries across 24 versions & 6 rubygems

Version Path
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/hashie-2.0.5/spec/hashie/hash_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/hashie-2.0.5/spec/hashie/hash_spec.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/hashie-2.0.5/spec/hashie/hash_spec.rb
climine-0.0.7 vendor/bundle/ruby/2.1.0/gems/hashie-2.0.5/spec/hashie/hash_spec.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/hashie-2.0.5/spec/hashie/hash_spec.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/hashie-2.0.5/spec/hashie/hash_spec.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/hashie-2.0.5/spec/hashie/hash_spec.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/hashie-2.0.5/spec/hashie/hash_spec.rb
climine-0.0.2 vendor/bundle/ruby/2.0.0/gems/hashie-2.0.5/spec/hashie/hash_spec.rb
climine-0.0.1 vendor/bundle/ruby/2.0.0/gems/hashie-2.0.5/spec/hashie/hash_spec.rb
hashie-2.0.5 spec/hashie/hash_spec.rb
hashie-2.0.4 spec/hashie/hash_spec.rb
hashie-2.0.3 spec/hashie/hash_spec.rb
hashie-2.0.2 spec/hashie/hash_spec.rb
hashie-2.0.1 spec/hashie/hash_spec.rb
hashie-2.0.0 spec/hashie/hash_spec.rb
cb_hashie-2.0.0.beta spec/hashie/hash_spec.rb
hashie-pre-2.0.0.beta spec/hashie/hash_spec.rb
hashie-1.1.0 spec/hashie/hash_spec.rb
hashie-1.0.0 spec/hashie/hash_spec.rb