Permalink
Browse files

tests for Failure.forall, Failure.exists methods

  • Loading branch information...
1 parent 0f9b9b5 commit 1234b9674ea0060a1753f1b659e95312ea9627fd Vasya Novikov committed Dec 23, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 core/common/src/test/scala/net/liftweb/common/BoxSpec.scala
@@ -245,7 +245,7 @@ class BoxSpec extends Specification with ScalaCheck with BoxGenerator {
val empty: Box[Int] = Empty
empty exists {_ > 0} must beFalse
}
- "define a 'forall' method returning false" in {
+ "define a 'forall' method returning true" in {
val empty: Box[Int] = Empty
empty forall {_ > 0} must beTrue
}
@@ -314,6 +314,12 @@ class BoxSpec extends Specification with ScalaCheck with BoxGenerator {
"create a new failure with a chained message if asked for its status with the operator ?~!" in {
Failure("error", Empty, Empty) ?~! "error2" must_== Failure("error2", Empty, Full(Failure("error", Empty, Empty)))
}
+ "return false for exist method" in {
+ Failure("error", Empty, Empty) exists {_ => true } must beFalse
+ }
+ "return true for forall method" in {
+ Failure("error", Empty, Empty) forall {_ => false } must beTrue
+ }
}
"A Box equals method" should {

0 comments on commit 1234b96

Please sign in to comment.