Skip to content

Commit 2777987

Browse files
committed
prepare release v0.28.0
1 parent c9209ca commit 2777987

File tree

4 files changed

+38
-30
lines changed

4 files changed

+38
-30
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased]
7+
## [0.28.0] 2023-12-05
88

99
### Changed
1010
- Minimum supported kotlin version is 1.9.21

README.md

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,47 @@ assertk is a fluent assertion library for Kotlin inspired by [AssertJ](https://g
1010

1111
## Why another assertion library?
1212

13-
You might be asking, "If AssertJ already exists, why create another library?". It's true, assertk is very similar to AssertJ. But assertk is written in Kotlin so it has one major advantage: extension methods. This makes adding your own assertion methods far simpler.
13+
You might be asking, "If AssertJ already exists, why create another library?". It's true, assertk is very similar to
14+
AssertJ. But assertk is written in Kotlin so it has one major advantage: extension methods. This makes adding your own
15+
assertion methods far simpler.
1416

1517
See [Custom Assertions](#custom-assertions) below to find out how to do this.
1618

1719
## Setup
1820

1921
```kotlin
2022
repositories {
21-
mavenCentral()
23+
mavenCentral()
2224
}
2325

2426
dependencies {
25-
testImplementation("com.willowtreeapps.assertk:assertk:0.27.0")
27+
testImplementation("com.willowtreeapps.assertk:assertk:0.28.0")
2628
}
2729
```
2830

2931
assertk has full multiplatform support and it can be used in jvm, js, or native projects. For example to set it up using
3032
the multiplatform plugin:
33+
3134
```kotlin
3235
plugins {
33-
kotlin("multiplatform")
36+
kotlin("multiplatform")
3437
}
3538

3639
kotlin {
37-
sourceSets {
38-
val commonTest by getting {
39-
dependencies {
40-
implementation("com.willowtreeapps.assertk:assertk:0.27.0")
41-
}
40+
sourceSets {
41+
val commonTest by getting {
42+
dependencies {
43+
implementation("com.willowtreeapps.assertk:assertk:0.28.0")
44+
}
45+
}
4246
}
43-
}
4447
}
4548
```
4649

4750
## Usage
4851

49-
Simple usage is to wrap the value or property you are testing in `assertThat()` and call assertion methods on the result.
52+
Simple usage is to wrap the value or property you are testing in `assertThat()` and call assertion methods on the
53+
result.
5054

5155
```kotlin
5256
import assertk.assertThat
@@ -75,9 +79,11 @@ class PersonTest {
7579
}
7680
```
7781

78-
You can see all built-in assertions in the [docs](https://willowtreeapps.github.io/assertk/assertk/assertk.assertions/index.html).
82+
You can see all built-in assertions in
83+
the [docs](https://willowtreeapps.github.io/assertk/assertk/assertk.assertions/index.html).
7984

8085
### Nullability
86+
8187
Since null is a first-class concept in kotlin's type system, you need to be explicit in your assertions.
8288

8389
```kotlin
@@ -128,14 +134,14 @@ assertAll {
128134
You can assert on the contents of an `Iterable/List` with the various `contains*` functions. They have different
129135
semantics as follows:
130136

131-
|Assertion|Description|
132-
|---|---|
133-
|containsAll|Asserts the iterable contains all the expected elements, in **any order**. The collection may also contain **additional elements**.|
134-
|containsSubList|Asserts that a collection contains a **subset** of items the **same order**, but may have **additional elements** in the list.|
135-
|containsOnly|Asserts the iterable contains **only the expected elements**, in **any order**. **Duplicate values** in the expected and actual are ignored.|
136-
|containsExactlyInAnyOrder|Asserts the iterable contains **exactly the expected elements**, in **any order**. Each value in expected must correspond to a matching value in actual, and visa-versa.|
137-
|containsExactly|Asserts the list contains **exactly the expected elements**. They must be in the **same order** and there must not be any extra elements.|
138-
|containsNone|Asserts the iterable **does not contain any** of the expected elements|
137+
| Assertion | Description |
138+
|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
139+
| containsAtLeast | Asserts the iterable contains at least the expected elements, in **any order**. The collection may also contain **additional elements**. |
140+
| containsSubList | Asserts that a collection contains a **subset** of items the **same order**, but may have **additional elements** in the list. |
141+
| containsOnly | Asserts the iterable contains **only the expected elements**, in **any order**. **Duplicate values** in the expected and actual are ignored. |
142+
| containsExactlyInAnyOrder | Asserts the iterable contains **exactly the expected elements**, in **any order**. Each value in expected must correspond to a matching value in actual, and visa-versa. |
143+
| containsExactly | Asserts the list contains **exactly the expected elements**. They must be in the **same order** and there must not be any extra elements. |
144+
| containsNone | Asserts the iterable **does not contain any** of the expected elements |
139145

140146
### Extracting data
141147

@@ -236,11 +242,11 @@ return something more specific that additional assertions can be chained on.
236242

237243
```kotlin
238244
fun Assert<Person>.hasMiddleName(): Assert<String> = transform(appendName("middleName", separator = ".")) { actual ->
239-
if (actual.middleName != null) {
240-
actual.middleName
241-
} else {
242-
expected("to not be null")
243-
}
245+
if (actual.middleName != null) {
246+
actual.middleName
247+
} else {
248+
expected("to not be null")
249+
}
244250
}
245251

246252
assertThat(person).hasMiddleName().isEqualTo("Lorie")
@@ -263,4 +269,6 @@ error message.
263269

264270
## Contributing to assertk
265271

266-
Contributions are more than welcome! Please see the [Contributing Guidelines](https://github.com/willowtreeapps/assertk/blob/main/Contributing.md) and be mindful of our [Code of Conduct](https://github.com/willowtreeapps/assertk/blob/main/code-of-conduct.md).
272+
Contributions are more than welcome! Please see
273+
the [Contributing Guidelines](https://github.com/willowtreeapps/assertk/blob/main/Contributing.md) and be mindful of
274+
our [Code of Conduct](https://github.com/willowtreeapps/assertk/blob/main/code-of-conduct.md).

assertk-coroutines/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ repositories {
1111
}
1212
1313
dependencies {
14-
testCompile 'com.willowtreeapps.assertk:assertk-coroutines:0.23'
14+
testCompile("com.willowtreeapps.assertk:assertk-coroutines:0.28.0")
1515
}
1616
```
1717

1818
## Usage
1919

2020
### Flow
2121

22-
Currently, the main thing this lib provides is many of the collection assertions on `Flow`. For example you can do
22+
Currently, the main thing this lib provides is many of the collection assertions on `Flow`. For example, you can do
2323

2424
```kotlin
2525
runBlocking {

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
assertk = "0.28.0-SNAPSHOT"
2+
assertk = "0.28.0"
33
kotlin = "1.9.21"
44
kotlinx-coroutines = "1.7.3"
55
[libraries]

0 commit comments

Comments
 (0)