Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jqno
Created March 1, 2012 20:51
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 jqno/1953157 to your computer and use it in GitHub Desktop.
Save jqno/1953157 to your computer and use it in GitHub Desktop.
Symmetry of Box's equals method
package net.liftweb.common
import org.junit.runner.RunWith
import org.scalatest.FlatSpec
import org.scalatest.junit.JUnitRunner
import org.scalatest.matchers.ShouldMatchers
@RunWith(classOf[JUnitRunner])
class BoxTest extends FlatSpec with ShouldMatchers {
val foo = "foo"
val boxedFoo = Full(foo)
"Box" should "be symmetric" in {
(foo == boxedFoo) should equal (boxedFoo == foo)
}
it should "be recoverable from a collection???" in {
val list = List(boxedFoo)
(list contains foo) should be (true)
}
it should "be usable to recover something from a collection???" in {
val list = List(foo)
(list contains boxedFoo) should be (true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment