mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
17 lines
402 B
Ruby
17 lines
402 B
Ruby
require 'testing_env'
|
|
require 'utils/json'
|
|
|
|
class JsonSmokeTest < Homebrew::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
|