diff options
author | Florian Frank <flori@ping.de> | 2010-03-13 21:11:58 +0100 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2010-03-13 21:11:58 +0100 |
commit | c3e8dd92f04b010366e4d7152c83c7486af93e1e (patch) | |
tree | 883b600b03e7a5788f50fe4f71b4fe9f88f7ef9f /tests/test_json.rb | |
parent | 92b013ce8e0a5c3caefd15f450409ed69aa539f2 (diff) | |
parent | 3db50701a4a71e49709c63483d2ba4b5a408373b (diff) | |
download | json-c3e8dd92f04b010366e4d7152c83c7486af93e1e.tar.gz |
Merge commit 'v1.2.3'
Merged in some additional features from the v1.2 branch.
Diffstat (limited to 'tests/test_json.rb')
-rwxr-xr-x | tests/test_json.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_json.rb b/tests/test_json.rb index 736c57b..3d26ddb 100755 --- a/tests/test_json.rb +++ b/tests/test_json.rb @@ -302,6 +302,13 @@ EOT assert_equal too_deep, ok end + def test_symbolize_names + assert_equal({ "foo" => "bar", "baz" => "quux" }, + JSON.parse('{"foo":"bar", "baz":"quux"}')) + assert_equal({ :foo => "bar", :baz => "quux" }, + JSON.parse('{"foo":"bar", "baz":"quux"}', :symbolize_names => true)) + end + def test_load_dump too_deep = '[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]' assert_equal too_deep, JSON.dump(eval(too_deep)) |