Sha256: 0c56ba278bfdf6dadb25f102a7fa0d549a1dd52abfe8f94ff329c9bdd54fb0f8
Contents?: true
Size: 983 Bytes
Versions: 5
Compression:
Stored size: 983 Bytes
Contents
require 'spec_helper' describe Hash do describe '.deep_symbolize_keys!' do before do @hash = { 'foo' => 'bar', 'nested_hash' => { 'nested_key' => 'nested_value'}, 'nested_array' => ['array_element'] } @hash.deep_symbolize_keys! end it 'should recursively symbolize keys' do expect(@hash).to eq({ :foo => 'bar', :nested_hash => { :nested_key => 'nested_value' }, :nested_array => ['array_element'] }) end end describe '.deep_stringify_keys!' do before do @hash = { :foo => 'bar', :nested_hash => { :nested_key => 'nested_value' }, :nested_array => ['array_element'] } @hash.deep_stringify_keys! end it 'should recursively stringify keys' do expect(@hash).to eq({ 'foo' => 'bar', 'nested_hash' => { 'nested_key' => 'nested_value'}, 'nested_array' => ['array_element'] }) end end end
Version data entries
5 entries across 5 versions & 1 rubygems