diff options
author | Mathias <mathias@spray.cc> | 2011-11-09 11:42:25 +0100 |
---|---|---|
committer | Mathias <mathias@spray.cc> | 2011-11-09 12:40:16 +0100 |
commit | 6cbaa4c1782bcb4060af9f8ef2fd72e737f7982a (patch) | |
tree | 32039efb3097ff16686819806da842539185d27f /src/test/scala/cc/spray/json/CollectionFormatsSpec.scala | |
parent | 9cda445514efe7700544e2b121c2258a69b9b207 (diff) | |
download | spray-json-6cbaa4c1782bcb4060af9f8ef2fd72e737f7982a.tar.gz spray-json-6cbaa4c1782bcb4060af9f8ef2fd72e737f7982a.tar.bz2 spray-json-6cbaa4c1782bcb4060af9f8ef2fd72e737f7982a.zip |
Fix #6 (rename JsValue:fromJson to 'convertTo', add .prettyPrint and .compactPrint
Diffstat (limited to 'src/test/scala/cc/spray/json/CollectionFormatsSpec.scala')
-rw-r--r-- | src/test/scala/cc/spray/json/CollectionFormatsSpec.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/scala/cc/spray/json/CollectionFormatsSpec.scala b/src/test/scala/cc/spray/json/CollectionFormatsSpec.scala index d0cb509..009d2e2 100644 --- a/src/test/scala/cc/spray/json/CollectionFormatsSpec.scala +++ b/src/test/scala/cc/spray/json/CollectionFormatsSpec.scala @@ -12,7 +12,7 @@ class CollectionFormatsSpec extends Specification with DefaultJsonProtocol { list.toJson mustEqual json } "convert a JsArray of JsNumbers to a List[Int]" in { - json.fromJson[List[Int]] mustEqual list + json.convertTo[List[Int]] mustEqual list } } @@ -23,7 +23,7 @@ class CollectionFormatsSpec extends Specification with DefaultJsonProtocol { array.toJson mustEqual json } "convert a JsArray of JsNumbers to an Array[Int]" in { - Arrays.equals(json.fromJson[Array[Int]], array) must beTrue + Arrays.equals(json.convertTo[Array[Int]], array) must beTrue } } @@ -34,7 +34,7 @@ class CollectionFormatsSpec extends Specification with DefaultJsonProtocol { map.toJson mustEqual json } "be able to convert a JsObject to a Map[String, Long]" in { - json.fromJson[Map[String, Long]] mustEqual map + json.convertTo[Map[String, Long]] mustEqual map } "throw an Exception when trying to serialize a map whose key are not serialized to JsStrings" in { Map(1 -> "a").toJson must throwA(new SerializationException("Map key must be formatted as JsString, not '1'")) @@ -48,7 +48,7 @@ class CollectionFormatsSpec extends Specification with DefaultJsonProtocol { set.toJson mustEqual json } "convert a JsArray of JsNumbers to a Set[Int]" in { - json.fromJson[Set[Int]] mustEqual set + json.convertTo[Set[Int]] mustEqual set } } @@ -59,7 +59,7 @@ class CollectionFormatsSpec extends Specification with DefaultJsonProtocol { seq.toJson mustEqual json } "convert a JsArray of JsNumbers to a IndexedSeq[Int]" in { - json.fromJson[collection.IndexedSeq[Int]] mustEqual seq + json.convertTo[collection.IndexedSeq[Int]] mustEqual seq } } |