Releases: willowtreeapps/assertk
Releases · willowtreeapps/assertk
v0.21
Added
- Add
any
to 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
isEqualToWithGivenProperties
andisEqualToIgnoringGivenProperties
to
be able to take nullable properties. - Improved the output of
containsExactly
to 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
/doesNotCorrespond
to compare values with a correspondence function. This is
useful when the value doesn't implementequals
.
Changed
- Changed the signature of
isEqualTo
fromAny?
toT
. This should not effect any existing code
due toT
being 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
isSuccess
failing on null return values
v0.19
v0.18
Added
- Add
extracting
to allow extracing a value for each item in an array. - Add
Assert<Result<T>>.isSuccess()
andAssert<Result<T>>.isFailure()
to replaceAssertBlock
assertions. - Add
messageContains
for throwable.
Changed
- Minimum supported kotlin version is 1.3.40
assertThat {}
andcatch {}
are inlined for better coroutine support- Improved display of
Pair
andTriple
Breaking Changes
AssertBlock
is removed and it's methods have been turned into extension functions onAssert<Result<T>>
.
You can migrate by:- Alt-enter on
returnedValue
,thrownError
, anddoesNotThrowAnyException
and 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
catch
in favor ofassertThat {}.isFailure()
v0.17
v0.16
v0.15
Added
- Add
isEqualToIgnoringGivenProperties
for the JVM - Add support for kotlin native
- Add
none
assertion for iterables
Changed
- Minimum supported kotlin version is 1.3.30
- Common artifact changed from
assertk-common
toassertk
- All previous deprecations on now at level error
Removed
- Deprecated
containsExactly
for maps
v0.14
v0.13
Added
- Add
isDataClassEqualTo
for better messaging when comparing data classes. - Add
matchesPredicate
to match against a predicate function/lambda. - Add
atLeast
iterable assertion which passes if the assertion on each item passes at least n times. - Add
isCloseTo
for floats and doubles to check that a value is within a delta of what's expected. - Add
lines
andbytes
to Path assertions for asserting on a file's contents. - Add
containsOnly
for Collection assertions.
Changed
- Sort
containsExactly
output by index to make it easier to compare. containsAll
now includes the expected map.
Fixed
- Number assertions now work correctly on BigInteger and BigDecimal
- Soft assertions breaking if exception is thrown.
Deprecated
- Deprecated
assert
in favor ofassertThat
. - Deprecated accessing the
actual
value on an assertion directly. Instead usegiven
which 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.