Skip to content

Instantly share code, notes, and snippets.

@joescii
Created March 3, 2014 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joescii/9336415 to your computer and use it in GitHub Desktop.
Save joescii/9336415 to your computer and use it in GitHub Desktop.
Some(null) sucks
import org.scalatest._
import org.scalatest.matchers.ShouldMatchers
class SomeNull extends FlatSpec with ShouldMatchers {
val o:Option[String] = Some(null)
"The option" should "not match Some(a)" in {
o match {
case Some(s) => s should not be (null)
case _ =>
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment