twitter/chill — pull request #52 by schmmd (2013-04-30 16:33:53+00:00)
Title: Update test case actually use the custom KryoInjection.

I recently submitted a pull request that was merged (https://github.com/twitter/chill/pull/51). Thank you for the vote of confidence. However, I didn't have it quite right. I didn't realize that Kryo will serialize objects that don't have a serializer registered because this does *not work on the scala console*.

> import com.twitter.chill._
> case class Point(x: Int, y: Int)
> KryoInjection.invert(KryoInjection(Point(4, 5)))
res0: Option[java.lang.Object] = None
> KryoBijection.invert(KryoBijection(Point(4, 5)))
com.esotericsoftware.kryo.KryoException: Unable to find class: Point

My test case worked and I figured it could only work with my custom `KryoInjection `class. Not so--since the case classes were not embedded inside another class they could use Kryo's default serialization. I moved these case classes inside the Spec and removed the misleading comment I had copied about how the case classes "should be outside KryoSpec".

The test case still passes, but it fails if I revert from `MyKryoInjection` to `KryoInjection`.