aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_json.rb
diff options
context:
space:
mode:
authorJack Nagel2013-01-14 22:32:37 -0600
committerJack Nagel2013-01-17 21:39:43 -0600
commite21156719f98b84c17b63ade994dbc00040ad4c4 (patch)
tree9f5c2629fd982cbac17aaba6840a50e3d77e93c1 /Library/Homebrew/test/test_json.rb
parentc1d2bbda6ab5a7fb6f60cf87a16d2778c45450f9 (diff)
downloadhomebrew-e21156719f98b84c17b63ade994dbc00040ad4c4.tar.bz2
Update multi_json to 1.5.0
This contains updates to the OkJson library that allow objects to define to_json for serialization, and this will be used in the upcoming options and deps work.
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