Sha256: 3c1798fd6aff7d64cc5bc3eef019d7203dc80716c37a05f59073d9a9e7f042cc
Contents?: true
Size: 377 Bytes
Versions: 26
Compression:
Stored size: 377 Bytes
Contents
require 'spec_helper' describe 'Hash#symbolize_keys' do it 'turn the hash keys into symbols' do hash = { 'one' => 1, 'two' => 2 } expect(hash.symbolize_keys).to eq({ one: 1, two: 2 }) end it 'leaves nonconvertible keys untouched' do hash = { 1 => 'one', [1, 1] => 'ones' } expect(hash.symbolize_keys).to eq({ 1 => 'one', [1, 1] => 'ones' }) end end
Version data entries
26 entries across 23 versions & 6 rubygems