Skip to content

Commit

Permalink
Test encoding symbol keys as strings
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Apr 14, 2011
1 parent 3b978a8 commit 4be991a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/multi_json_spec.rb
Expand Up @@ -53,6 +53,11 @@ def self.encode(string)
MultiJson.decode(MultiJson.encode(example)).should == example
end
end

it 'should encode symbol keys as strings' do
encoded_json = MultiJson.encode({ :foo => { :bar => 'baz' } })
MultiJson.decode(encoded_json).should == { 'foo' => { 'bar' => 'baz' } }
end
end

describe '.decode' do
Expand Down

0 comments on commit 4be991a

Please sign in to comment.