Created
March 1, 2012 20:51
-
-
Save jqno/1953157 to your computer and use it in GitHub Desktop.
Symmetry of Box's equals method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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