mirror of
https://github.com/mistydemeo/tigerbrew.git
synced 2026-11-27 03:19:46 -05:00
- Simplify encoding example because hashes are unordered. - Fix broken require
17 lines
411 B
Ruby
17 lines
411 B
Ruby
require 'testing_env'
|
|
require 'vendor/multi_json'
|
|
|
|
class JsonSmokeTest < Test::Unit::TestCase
|
|
def test_encode
|
|
hash = { "foo" => ["bar", "baz"] }
|
|
json = %q|{"foo":["bar","baz"]}|
|
|
assert_equal json, MultiJson.encode(hash)
|
|
end
|
|
|
|
def test_decode
|
|
hash = { "foo" => ["bar", "baz"], "qux" => 1 }
|
|
json = %q|{"foo":["bar","baz"],"qux":1}|
|
|
assert_equal hash, MultiJson.decode(json)
|
|
end
|
|
end
|