Skip to content

0.14.1

Compare
Choose a tag to compare
@eed3si9n eed3si9n released this 07 Oct 02:18
v0.14.1
b819416

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.

#29 by @Baccata

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

#28 by @Baccata

Dotty 0.27.0-RC1 support

Dotty 0.27 support ##27 by @Baccata