Added
- Add multi-value support for
Assert<String>.contains()
anddoesNotContain()
- Add
isEqualByComparingTo
to compare objects bycompareTo
instead ofequals
this is useful for cases like
BigDecimal
whereequals
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
, andcontainsOnly
fromCollection
toIterable
to make
them a bit more flexible. containsAll
,containsNone
, andcontainsOnly
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
withThrowable.addSurpressed
on the jvm (used when
collecting multiple exceptions withassertAll
). Unfortunately, if you are using gradle you won't see this due to a
known gradle issue. - No longer wrap exceptions in
AssertionError
s when usinggiven
andtransform
. Warning: this is techinicaly a
breaking change as code like:will no longer be caught. But you shouldn't be writing code like that anyway ;)try { assertThat(foo).given { throw MyException("error") } } catch (e: AssertionError) { // assume caught }
Fixed
- Don't let
assertAll
captureOutOfMemory
errors.
Breaking Changes
- Previously deprecated methods (as of 0.18) are now errors.