diff options
author | Mathias <mathias@spray.cc> | 2011-12-06 13:22:37 +0100 |
---|---|---|
committer | Mathias <mathias@spray.cc> | 2011-12-06 13:23:02 +0100 |
commit | 94b1fba92d40568c642a0b86c719c4bcc0865b54 (patch) | |
tree | 0c9a278e636426f99435b7e4f155cc2fe03495ff /src/test/scala/cc/spray/json/JsonParserSpec.scala | |
parent | 701be7bcf0a295c3de272a11e7cfb477db7ed026 (diff) | |
download | spray-json-94b1fba92d40568c642a0b86c719c4bcc0865b54.tar.gz spray-json-94b1fba92d40568c642a0b86c719c4bcc0865b54.tar.bz2 spray-json-94b1fba92d40568c642a0b86c719c4bcc0865b54.zip |
Remove JsField, turn JsObject(List[JsField]) into JsObject(Map[String, JsValue])
Diffstat (limited to 'src/test/scala/cc/spray/json/JsonParserSpec.scala')
-rw-r--r-- | src/test/scala/cc/spray/json/JsonParserSpec.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/scala/cc/spray/json/JsonParserSpec.scala b/src/test/scala/cc/spray/json/JsonParserSpec.scala index f030013..c298617 100644 --- a/src/test/scala/cc/spray/json/JsonParserSpec.scala +++ b/src/test/scala/cc/spray/json/JsonParserSpec.scala @@ -35,16 +35,16 @@ class JsonParserSpec extends Specification { } "properly parse a simple JsObject" in ( JsonParser(""" { "key" :42, "key2": "value" }""") mustEqual - JsObject(JsField("key", JsNumber(42)), JsField("key2", JsString("value"))) + JsObject("key" -> JsNumber(42), "key2" -> JsString("value")) ) "properly parse a simple JsArray" in ( JsonParser("""[null, 1.23 ,{"key":true } ] """) mustEqual - JsArray(JsNull, JsNumber(1.23), JsObject(JsField("key", JsBoolean(true)))) + JsArray(JsNull, JsNumber(1.23), JsObject("key" -> JsBoolean(true))) ) "be reentrant" in { val largeJsonSource = FileUtils.readAllCharsFromResource("test.json") List.fill(20)(largeJsonSource).par.map(JsonParser(_)).toList.map { - _.asInstanceOf[JsObject].asMap("questions").asInstanceOf[JsArray].elements.size + _.asInstanceOf[JsObject].fields("questions").asInstanceOf[JsArray].elements.size } mustEqual List.fill(20)(100) } } |