Skip to content

0.12.0

Compare
Choose a tag to compare
@eed3si9n eed3si9n released this 22 Jul 03:57
v0.12.0

Expecty 0.12.0 is built to Scala 2.11, 2.12, 2.13, 0.6 (Dotty), sjs0.6_2.11, sjs0.6_2.12, sjs0.6_2.13, and native0.3_2.11.

Predef.assert-like API

Expecty 0.12.0 changes the signature of assert function to def assert(Boolean): Unit and def assert(Boolean, => String): Unit to be same as that of Presef.assert.

scala> assert(person.age * 2 == 73, "age is not right")
java.lang.AssertionError: assertion failed: age is not right

assert(person.age * 2 == 73, "age is not right")
       |      |   |   |
       |      42  84  false
       Person(Fred,42)

  at com.eed3si9n.expecty.Expecty$ExpectyListener.expressionRecorded(Expecty.scala:35)
  at com.eed3si9n.expecty.RecorderRuntime.recordExpression(RecorderRuntime.scala:39)
  ... 36 elided

The second variant allows a custom message to be passed in. #19 by @eed3si9n

Dotty support

Expecty 0.12.0 is cross built for Dotty 0.16.0-RC3 using Dotty Macro.

To try Expecty on Dotty,

$ sbt new lampepfl/dotty.g8

and add the following to build.sbt

    libraryDependencies += "com.eed3si9n.expecty" %% "expecty" % "0.12.0" % Test,

#17 by @eed3si9n