Skip to content

Commit

Permalink
JSON serialization doesn't guarantee the order
Browse files Browse the repository at this point in the history
URI spec had a syntax not compatible with 1.8.7
  • Loading branch information
achamian committed Dec 9, 2011
1 parent f85db38 commit abc983b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spec/wrest/components/translators/json_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ module Wrest::Components::Translators
end

it "should know how to convert json to a hashmap" do
json = "{\"menu\":\"File\",\"commands\":[{\"title\":\"New\",\"action\":\"CreateDoc\"},{\"title\":\"Open\",\"action\":\"OpenDoc\"},{\"title\":\"Close\",\"action\":\"CloseDoc\"}]}"
hash = {
"menu"=>"File",
"commands"=>[{
Expand All @@ -41,7 +40,8 @@ module Wrest::Components::Translators
"action"=>"OpenDoc"},
{"title"=>"Close", "action"=>"CloseDoc"}
]}
Json.serialise(hash).should eq(json)
Json.serialise(hash).should include("\"menu\":\"File\"")
Json.serialise(hash).should include("\"commands\":[{\"title\":\"New\",\"action\":\"CreateDoc\"},{\"title\":\"Open\",\"action\":\"OpenDoc\"},{\"title\":\"Close\",\"action\":\"CloseDoc\"}]")
end

it "has #deserialize delegate to #deserialise" do
Expand Down
2 changes: 1 addition & 1 deletion spec/wrest/uri_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def setup_connection
let(:uri) { 'http://ooga.com'.to_uri(:default_headers => oauth_header) }

it "lets incoming default_headers take precedence when the Uri is extended" do
uri['/foo', :default_headers => content_type_header].default_headers.should eq(content_type_header)
uri['/foo', {:default_headers => content_type_header}].default_headers.should eq(content_type_header)
end

{
Expand Down

0 comments on commit abc983b

Please sign in to comment.