I'm trying to integrate ScalaCheck into our unit specifications in specs2. I must be missing something on how this works:
class TestCase extends PlaySpecification with ScalaCheck {
"The container data model" should {
val validIdRange = Gen.choose(1,GPDataTypes.integer._2)
def chk(n: Int, d: Int) = {
val g = new GPGlimple(n, true, true)
g.accountId mustEqual 1 // should fail (actually equals n)
g.id must beNone
g.created must beNone
}
val idPairs = forAll(validIdRange, validIdRange) { (n: Int, d: Int) => chk(n, d) }
"support basic glimple constructors" in {
idPairs.check
}
}
}
However, this test executes without failure. It should definitely fail on the 'mustEqual 1' (which I've intentionally changed to 1, it actually equals n). The results in the test output, however...
[info] The glimple container data model should [info] + support basic glimple constructors