I am looking for a library similar to <https://git...
# test
p
I am looking for a library similar to https://github.com/MarkusAmshove/Kluent that would let me specify custom assert messages. So that when the test fails, it’s a bit more descriptive than
Expected true but got false
l
Maybe #kotest with
withClue
?
p
Kotest replaces JUnit?
maybe i could just use the assertions sub-project
d
Or #strikt
👍 1
d
Good old assertJ works as well
c
if you need only assertions i would recomment #strikt
👍 1
p
hmm. I don’t like that #strikt does not use
infix
for assertions
it doesn’t read as nice
d
Each one with their preferences, I don't like infixes, they spill tons of top level funs into my code complete...
Even when not trying to write assertion code...
a
There is also Atrium It's multiplatform assertions library for Kotlin. It will do everything you want. Very powerful... Maybe even too much over-engineered 🤔
r
@poohbar let me know in case you should try out Atrium. Feedback for the infix API is appreciated
p
@robstoll I would recommend working on the readme a bit. Structuring it a bit better and maybe making it shorter. The library itself looks super powerful, but maybe too powerful for my needs. And it's again missing my most desired feature which is fluent assertions:
expected shouldEqual actual
just reads so naturally 🙂
r
Suggestions about a different structure are welcome, any idea? Note that the README is using the api-fluent and not the api-infix. You see examples of the api-infix version here: https://github.com/robstoll/atrium/blob/master/apis/differences.md For instance, you would write:
Copy code
expect(1) toBe 2
expect(listOf(1,2)) toBe empty
expect("hello Robert") contains o ignoring case notOrAtMost 1 the regexPatterns("h(e|a)llo", "[Rr]obert")