Sha256: aff932577ff9ee5fe18c4d7ca4514bc35eaa796ffa24d66d3ffafbe3668e787e

Contents?: true

Size: 540 Bytes

Versions: 4

Compression:

Stored size: 540 Bytes

Contents

require 'spec_helper'
module Alf
  describe Support, 'symbolize_keys' do
    include Support

    subject{ symbolize_keys(arg) }

    context 'with an empty Hash' do
      let(:arg){ Hash.new }
      it { should eq({}) }
    end

    context 'with a Hash with all symbols already' do
      let(:arg){ {:name => "Jones", :id => 2} }
      it { should eq(arg) }
    end

    context 'with a Hash with String keys' do
      let(:arg){ {"name" => "Jones", "id" => 2} }
      it { should eq({:name => "Jones", :id => 2}) }
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-support/test_symbolize_keys.rb
alf-core-0.14.0 spec/unit/alf-support/test_symbolize_keys.rb
alf-core-0.13.1 spec/unit/alf-support/test_symbolize_keys.rb
alf-core-0.13.0 spec/unit/alf-support/test_symbolize_keys.rb