Skip to content
Browse files

rewrite order dependent test case. #8185

As reported (#8185 (comment))
this test relied on the order a hash was serialized. Comparing the parsed
hash makes the test no longer order dependent.
  • Loading branch information...
1 parent 2283a1d commit e68505a41a5c4ceeb0ed343daa0433846b054076 @senny senny committed Dec 27, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 activesupport/test/json/encoding_test.rb
View
3 activesupport/test/json/encoding_test.rb
@@ -276,7 +276,8 @@ def test_to_json_should_not_keep_options_around
f.bar = "world"
hash = {"foo" => f, "other_hash" => {"foo" => "other_foo", "test" => "other_test"}}
- assert_equal(%({"foo":{"foo":"hello","bar":"world"},"other_hash":{"foo":"other_foo","test":"other_test"}}), hash.to_json)
+ assert_equal({"foo"=>{"foo"=>"hello","bar"=>"world"},
+ "other_hash" => {"foo"=>"other_foo","test"=>"other_test"}}, JSON.parse(hash.to_json))
end
def test_struct_encoding

0 comments on commit e68505a

Please sign in to comment.
Something went wrong with that request. Please try again.