brew/Library/Homebrew/test/test_json.rb
BrewTestBot 13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00

17 lines
398 B
Ruby

require "testing_env"
require "utils/json"
class JsonSmokeTest < Homebrew::TestCase
def test_encode
hash = { "foo" => ["bar", "baz"] }
json = '{"foo":["bar","baz"]}'
assert_equal json, Utils::JSON.dump(hash)
end
def test_decode
hash = { "foo" => ["bar", "baz"], "qux" => 1 }
json = '{"foo":["bar","baz"],"qux":1}'
assert_equal hash, Utils::JSON.load(json)
end
end