blob: f77b7852d988d2c30da3eecb6aeef926c5947ff5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
require 'testing_env'
require 'utils/json'
class JsonSmokeTest < Test::Unit::TestCase
def test_encode
hash = { "foo" => ["bar", "baz"] }
json = %q|{"foo":["bar","baz"]}|
assert_equal json, Utils::JSON.dump(hash)
end
def test_decode
hash = { "foo" => ["bar", "baz"], "qux" => 1 }
json = %q|{"foo":["bar","baz"],"qux":1}|
assert_equal hash, Utils::JSON.load(json)
end
end
|