Releases: assertk-org/assertk
Releases · assertk-org/assertk
v0.21
Added
- Add
anyto iterable assertions. It will pass when any of the provided assertions pass.
Changed
- Minimum supported kotlin version is 1.3.60
- Changed the signatures of
isEqualToWithGivenPropertiesandisEqualToIgnoringGivenPropertiesto
be able to take nullable properties. - Improved the output of
containsExactlyto show the entire list. - Render tabs and newlines in diffs to make clear what's different.
Fixed
- Fixed issues with nested soft assertions. (#253)
v0.20
Added
- Add
corresponds/doesNotCorrespondto compare values with a correspondence function. This is
useful when the value doesn't implementequals.
Changed
- Changed the signature of
isEqualTofromAny?toT. This should not effect any existing code
due toTbeing covariant. The one improvement this brings is that literal numbers can be inferred
to the correct type. Before this changeassertThat(1L).isEqualTo(1)would fail, now it passes.
Fixed
- Fixed
isSuccessfailing on null return values
v0.19
v0.18
Added
- Add
extractingto allow extracing a value for each item in an array. - Add
Assert<Result<T>>.isSuccess()andAssert<Result<T>>.isFailure()to replaceAssertBlockassertions. - Add
messageContainsfor throwable.
Changed
- Minimum supported kotlin version is 1.3.40
assertThat {}andcatch {}are inlined for better coroutine support- Improved display of
PairandTriple
Breaking Changes
AssertBlockis removed and it's methods have been turned into extension functions onAssert<Result<T>>.
You can migrate by:- Alt-enter on
returnedValue,thrownError, anddoesNotThrowAnyExceptionand select import. - Alt-enter on the deprecated version of above and choose replace with...
- If your expression only has 1 value, you can replace ex:
isSucess().all { isEqualTo(1) }withisSuccess().isEqualTo(1)
- Alt-enter on
Deprecated
- Deprecated
catchin favor ofassertThat {}.isFailure()
v0.17
v0.16
v0.15
Added
- Add
isEqualToIgnoringGivenPropertiesfor the JVM - Add support for kotlin native
- Add
noneassertion for iterables
Changed
- Minimum supported kotlin version is 1.3.30
- Common artifact changed from
assertk-commontoassertk - All previous deprecations on now at level error
Removed
- Deprecated
containsExactlyfor maps
v0.14
v0.13
Added
- Add
isDataClassEqualTofor better messaging when comparing data classes. - Add
matchesPredicateto match against a predicate function/lambda. - Add
atLeastiterable assertion which passes if the assertion on each item passes at least n times. - Add
isCloseTofor floats and doubles to check that a value is within a delta of what's expected. - Add
linesandbytesto Path assertions for asserting on a file's contents. - Add
containsOnlyfor Collection assertions.
Changed
- Sort
containsExactlyoutput by index to make it easier to compare. containsAllnow includes the expected map.
Fixed
- Number assertions now work correctly on BigInteger and BigDecimal
- Soft assertions breaking if exception is thrown.
Deprecated
- Deprecated
assertin favor ofassertThat. - Deprecated accessing the
actualvalue on an assertion directly. Instead usegivenwhich will provide it in a lambda. - Deprecated some methods that took a lambda, replacing them with versions that chain instead.
isNotNull()isInstanceOf()index()key()
Breaking Changes
- Previously deprecated methods (as of 0.10) are now errors.
v0.12: Merge pull request #120 from willowtreeapps/packaging-fixes
Fixed
- Bumped the kotlin version to 1.2.50 to fix a packaging issue.
- Remove
<packaging>pom</packaging>as it should be using the default jar packaging.