aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_json.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/test_json.rb')
-rw-r--r--Library/Homebrew/test/test_json.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_json.rb b/Library/Homebrew/test/test_json.rb
new file mode 100644
index 000000000..458cfd123
--- /dev/null
+++ b/Library/Homebrew/test/test_json.rb
@@ -0,0 +1,16 @@
+require 'testing_env'
+require 'vendor/multi_json'
+
+class JsonSmokeTest < Test::Unit::TestCase
+ def test_encode
+ hash = { "foo" => ["bar", "baz"], "qux" => 1 }
+ json = %q|{"foo":["bar","baz"],"qux":1}|
+ 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