https://github.com/opengood-aio/kotest-extensions
Library containing reusable extensions and functions for Kotest
https://github.com/opengood-aio/kotest-extensions
library protected-branches-true update-copyright-current-year
Last synced: 6 months ago
JSON representation
Library containing reusable extensions and functions for Kotest
- Host: GitHub
- URL: https://github.com/opengood-aio/kotest-extensions
- Owner: opengood-aio
- License: mit
- Created: 2021-04-26T18:46:49.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-05-27T21:02:04.000Z (about 1 year ago)
- Last Synced: 2025-08-22T07:51:34.996Z (11 months ago)
- Topics: library, protected-branches-true, update-copyright-current-year
- Language: Kotlin
- Homepage:
- Size: 181 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Kotest Extensions Library
[](https://github.com/opengood-aio/kotest-extensions/actions?query=workflow%3Abuild)
[](https://github.com/opengood-aio/kotest-extensions/actions?query=workflow%3Arelease)
[](https://github.com/opengood-aio/kotest-extensions/actions/workflows/codeql.yml)
[](https://codecov.io/gh/opengood-aio/kotest-extensions)
[](https://github.com/opengood-aio/kotest-extensions/releases/latest)
[](https://search.maven.org/search?q=g:%22io.opengood.extensions%22%20AND%20a:%22kotest-extensions%22)
[](https://raw.githubusercontent.com/opengood-aio/kotest-extensions/master/LICENSE)
Library containing reusable extensions and functions for Kotest
## Compatibility
* Java 21
* Spring Boot 3
## Setup
### Add Dependency
#### Gradle
```groovy
implementation("io.opengood.extensions:kotest-extensions:VERSION")
```
#### Maven
```xml
io.opengood.extensions
kotest-extensions
VERSION
```
**Note:** See *Release* version badge above for latest version.
## Features
### Matchers
#### Map
* Assert list of maps are equal ignoring specific keys:
Example:
```kotlin
import io.opengood.extensions.kotest.matcher
val expected = listOf(
mapOf("foo" to "bar"),
mapOf("foo" to "baz")
)
val items = listOf(
mapOf(
"none" to "none",
"foo" to "bar"
),
mapOf(
"none" to "none",
"foo" to "baz"
)
)
items.shouldBeEqualIgnoringKeys(expected, "none")
```
* Assert map entries are equal:
Example:
```kotlin
import io.opengood.extensions.kotest.matcher
fun makeEntry(key: String, value: String) = object : Map.Entry {
override val key: String = key
override val value: String = value
}
val expected = makeEntry("foo", "bar")
makeEntry("foo", "bar") shouldBeMapEntry expected
```