summaryrefslogtreecommitdiff
path: root/src/test/scala/spray/json/ProductFormatsSpec.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/spray/json/ProductFormatsSpec.scala')
-rw-r--r--src/test/scala/spray/json/ProductFormatsSpec.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/scala/spray/json/ProductFormatsSpec.scala b/src/test/scala/spray/json/ProductFormatsSpec.scala
index e452639..ec9d65f 100644
--- a/src/test/scala/spray/json/ProductFormatsSpec.scala
+++ b/src/test/scala/spray/json/ProductFormatsSpec.scala
@@ -84,4 +84,15 @@ class ProductFormatsSpec extends Specification {
}
}
+ "A JsonFormat for a generic case class with an explicitly provided type parameter" should {
+ "support the jsonFormat1 syntax" in {
+ case class Box[A](a: A)
+ object BoxProtocol extends DefaultJsonProtocol {
+ implicit val boxFormat = jsonFormat1(Box[Int])
+ }
+ import BoxProtocol._
+ Box(42).toJson === JsObject(Map("a" -> JsNumber(42)))
+ }
+ }
+
}