Sha256: b775970674a03d7c97f4d7fb366161532400062533810530008b2147316ac872

Contents?: true

Size: 385 Bytes

Versions: 3

Compression:

Stored size: 385 Bytes

Contents

require "spec_helper"

describe 'Hash' do
  it 'should symbolize hashes in arbitrary objects' do
    as_string = {
      'a'   => 'a',
      'b'   => {
        'a' => [{'a' => 'a'}]
      }
    }
    as_symbol = {
      a: 'a',
      b: {
        a: [{a: 'a'}]
      }
    }

    Hash.symbolize(as_string).should == as_symbol
    Hash.stringify(as_symbol).should == as_string
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_ext-4.0.3 spec/core/hash_spec.rb
ruby_ext-4.0.2 spec/core/hash_spec.rb
ruby_ext-4.0.1 spec/core/hash_spec.rb