Skip to content

v0.22

Compare
Choose a tag to compare
@evant evant released this 30 Jul 15:28
· 186 commits to main since this release

Added

  • Add multi-value support for Assert<String>.contains() and doesNotContain()
  • Add isEqualByComparingTo to compare objects by compareTo instead of equals this is useful for cases like
    BigDecimal where equals would fail because of differing precision.
  • Add containsOnly for arrays.

Changed

  • Minimum supported kotlin version is 1.3.70
  • Updated opentest4j to 1.2.0. This changes the multiple assertion message to include each exception class name.
  • Moved containsAll, containsNone, and containsOnly from Collection to Iterable to make
    them a bit more flexible.
  • containsAll, containsNone, and containsOnly error messages now include the expected and actual lists.
  • Unwrap exceptions thrown by prop(callable: KCallable<*>) to make them more clear.
  • Add all exception stacktraces to a MultipleFailuresError with Throwable.addSurpressed on the jvm (used when
    collecting multiple exceptions with assertAll). Unfortunately, if you are using gradle you won't see this due to a
    known gradle issue.
  • No longer wrap exceptions in AssertionErrors when using given and transform. Warning: this is techinicaly a
    breaking change as code like:
    try {
        assertThat(foo).given { throw MyException("error") }
    } catch (e: AssertionError) {
        // assume caught
    }
    will no longer be caught. But you shouldn't be writing code like that anyway ;)

Fixed

  • Don't let assertAll capture OutOfMemory errors.

Breaking Changes

  • Previously deprecated methods (as of 0.18) are now errors.