Discipline integration
Weaver comes with basic Discipline integration, allowing property-based law testing.
Installation
You'll need to install an additional dependency in order to use Discipline with Weaver.
SBT
libraryDependencies += "com.disneystreaming" %% "weaver-discipline" % "0.0-0e0ca96-SNAPSHOT" % Test
Mill
object test extends Tests {
def ivyDeps = Agg(
ivy"com.disneystreaming::weaver-discipline:0.0-0e0ca96-SNAPSHOT"
)
}
Usage
Add the weaver.discipline.Discipline
mixin to a FunSuite
to use Discipline within your test suite.
import weaver._
import weaver.discipline._
import cats.kernel.laws.discipline.EqTests
object DisciplineTests extends FunSuite with Discipline {
checkAll("Int", EqTests[Int].eqv)
checkAll("Boolean", EqTests[Boolean].eqv)
}
repl.MdocSessionMdocAppDisciplineTests + Int: eq.antisymmetry eq 24ms + Int: eq.reflexivity eq 5ms + Int: eq.symmetry eq 5ms + Int: eq.transitivity eq 7ms + Boolean: eq.antisymmetry eq 6ms + Boolean: eq.reflexivity eq 1ms + Boolean: eq.symmetry eq 1ms + Boolean: eq.transitivity eq 1ms Total 8, Failed 0, Passed 8, Ignored 0, Cancelled 0