0.14.1
Expecty 0.14.1 is built to Scala 2.11, 2.12, 2.13, 0.27.0-RC1 (Dotty), sjs1_2.11, sjs1_2.12, sjs1_2.13, and native0.3_2.11.
expect(...) takes vararg
Expecty 0.14.1 supports vararg using expect(...)
method.
scala> import com.eed3si9n.expecty.Expecty.expect
import com.eed3si9n.expecty.Expecty.expect
scala> expect(
| "abc".length() == 3,
| "def".length() == 2,
| "fgh".length() == 1,
| )
java.lang.AssertionError: assertion failed
"def".length() == 2,
| |
3 false
at com.eed3si9n.expecty.ExpectyBase$ExpectyListener.expressionRecorded(Expecty.scala:38)
at com.eed3si9n.expecty.RecorderRuntime.recordExpression(RecorderRuntime.scala:39)
... 40 elided
This brings back the multi parameter expect(...)
from older pre-0.12 Expecty, but using vararg instead of block statement.
Source location
Expecty 0.14.1 adds optional source location information.
import com.eed3si9n.expecty.Expecty
val assert = new Expecty { override val showLocation = true }
assert("abc".length() == 2)
This will output:
assertion failed (jvm/src/test/scala/org/expecty/ExpectyLocationSpec.scala:32)
assert("abc".length() == 2)
| |
3 false