hamkrest alternatives and similar libraries
Based on the "Tests" category.
Alternatively, view hamkrest alternatives based on common mentions on social networks and blogs.
Do you think we are missing an alternative of hamkrest or a related project?
Hamkrest - Hamcrest for Kotlin
An implementation of Hamcrest to take advantage of Kotlin language features.
Note: as of version 220.127.116.11, you must add kotlin-reflect to the classpath to use Hamkrest's reflective features.
Add Hamkrest as a dependency of your project. Hamkrest is distributed via Maven Central.
Import matchers from
com.natpryce.hamkrest. E.g. a quick way to get started is to import
com.natpryce.hamkrest.* and then use IntelliJ to optimise imports when you're done.
If you're using Hamkrest for assertions, import
Now you can make assertions about values using matchers:
assertThat(thisName, equalTo("Alice")) assertThat(thatName, equalTo("Bob"))
... and so forth
- [Matching numbers](docs/numbers.md)
- [Composing matchers](docs/compose.md)
- [Using function and method references as Matchers](docs/function-references.md)
- [How Hamkrest describes values, and how you can plug in your own descriptions](docs/describe.md)
- [Hamkrest's version numbers explained](docs/version-numbering.md)