Hi,
trying to set up basic test with ResultMatchers like this:
import org.scalatest.{FlatSpec, Matchers}
import com.wix.accord._
import com.wix.accord.dsl._
import com.wix.accord.scalatest.ResultMatchers
object PrimitiveSchema {
case class Person( firstName: String, lastName: String )
case class Classroom( teacher: Person, students: Seq[ Person ] )
implicit val personValidator = validator[ Person ] { p =>
p.firstName is notEmpty
p.lastName is notEmpty
}
implicit val classValidator = validator[ Classroom ] { c =>
c.teacher is valid
c.students.each is valid
c.students have size > 0
}
}
class TestSpec extends FlatSpec with Matchers with ResultMatchers {
it should "validate The Person" in {
val sample = PrimitiveSchema.Person( "Wernher", "von Braun" )
val result = validate( sample )
result should be aSuccess
}
}
but the compiler says:
Error:(29, 22) value aSuccess is not a member of TestSpec.this.ResultOfBeWordForAny[com.wix.accord.Result]
result should be aSuccess
Hi, trying to set up basic test with
ResultMatchers
like this:but the compiler says:
accord
0.7.2
scala2.12.6
thanks for any help!