Sha256: 862157fa167b3315d2255eb0c9cc5033e73f98cad9c3fff3a04f2c84f19cb2ed

Contents?: true

Size: 765 Bytes

Versions: 11

Compression:

Stored size: 765 Bytes

Contents

require File.dirname(__FILE__) + '/../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

11 entries across 11 versions & 3 rubygems

Version Path
hashie-0.2.1 spec/hashie/hash_spec.rb
pancake-0.3.0 lib/pancake/vendor/hashie/spec/hashie/hash_spec.rb
hashie-0.2.0 spec/hashie/hash_spec.rb
zerobearing-hashie-0.1.9 spec/hashie/hash_spec.rb
hashie-0.1.8 spec/hashie/hash_spec.rb
hashie-0.1.6 spec/hashie/hash_spec.rb
hashie-0.1.5 spec/hashie/hash_spec.rb
hashie-0.1.4 spec/hashie/hash_spec.rb
hashie-0.1.3 spec/hashie/hash_spec.rb
hashie-0.1.2 spec/hashie/hash_spec.rb
hashie-0.1.0 spec/hashie/hash_spec.rb