Skip to content
Snippets Groups Projects
Commit 716b4080 authored by Markus Reiter's avatar Markus Reiter Committed by GitHub
Browse files

Merge pull request #2011 from reitermarkus/json-test

Remove JSON test.
parents 9c3825fc 2f919089
No related branches found
No related tags found
No related merge requests found
require "testing_env"
require "json"
class JsonSmokeTest < Homebrew::TestCase
def test_encode
hash = { "foo" => ["bar", "baz"] }
json = '{"foo":["bar","baz"]}'
assert_equal json, JSON.generate(hash)
end
def test_decode
hash = { "foo" => ["bar", "baz"], "qux" => 1 }
json = '{"foo":["bar","baz"],"qux":1}'
assert_equal hash, JSON.parse(json)
end
def test_decode_failure
assert_raises(JSON::ParserError) { JSON.parse("nope") }
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment