Skip to content
Permalink
Browse files

Merge pull request #285 from seratch/feature/issue137

Fix #137 Make DefaultFormats serializable
  • Loading branch information
seratch committed Aug 19, 2015
2 parents a682d62 + 1c8e944 commit 961fb27f5e69669fddc6bae77079a999fc6f04a1
Showing with 22 additions and 1 deletion.
  1. +1 −1 core/src/main/scala/org/json4s/Formats.scala
  2. +21 −0 tests/src/test/scala/org/json4s/FormatsSpec.scala
@@ -37,7 +37,7 @@ object Formats {
@implicitNotFound(
"No org.json4s.Formats found. Try to bring an instance of org.json4s.Formats in scope or use the org.json4s.DefaultFormats."
)
trait Formats { self: Formats =>
trait Formats extends Serializable { self: Formats =>
def dateFormat: DateFormat
def typeHints: TypeHints = NoTypeHints
def customSerializers: List[Serializer[_]] = Nil
@@ -0,0 +1,21 @@
package org.json4s

import org.specs2.mutable.Specification

class FormatsSpec extends Specification {

"Formats" should {
"be a Serializable" in {
val f = new Formats {
def dateFormat: DateFormat = ???
}
f.isInstanceOf[Serializable] must beTrue
}
}

"DefaultFormats" should {
"be a Serializable" in {
DefaultFormats.isInstanceOf[Serializable] must beTrue
}
}
}

0 comments on commit 961fb27

Please sign in to comment.
You can’t perform that action at this time.