Sha256: 24834bdddeeab37701aae7261afaf899c7beb0ca9322036b3608fc9267145bd3

Contents?: true

Size: 397 Bytes

Versions: 9

Compression:

Stored size: 397 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Utils, '.symbolize_keys' do

  subject { described_class.symbolize_keys(hash) }

  context "with no nested hash" do
    let(:hash) { { 'foo' => 'bar' } }

    it { should == { :foo => 'bar'} }
  end

  context "with a nested hash" do
    let(:hash) { { 'foo' => { 'bar' => 'baz' } } }

    it { should == { :foo => { :bar => 'baz'} } }
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
substation-0.0.10.beta2 spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb
substation-0.0.8 spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb
substation-0.0.7 spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb
substation-0.0.6 spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb
substation-0.0.5 spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb
substation-0.0.4 spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb
substation-0.0.3 spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb
substation-0.0.2 spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb
substation-0.0.1 spec/unit/substation/utils/class_methods/symbolize_keys_spec.rb