-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support grouped assertions #7
Comments
CLOVIS-AI
added a commit
to CLOVIS-AI/Prepared
that referenced
this issue
Aug 10, 2024
…ing at the moment See varabyte/truthish#7
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
External comment from a dev:
Assertion frameworks often provide a way to combine multiple assertions into a single one.
For example, with Kotest:
With AssertK:
It doesn't seem like Google Truth provides a way to do this itself, so I don't have any explicit guidance in this case.
We can take a page out of JUnit's book using
assertAll(...)
which in Truthish might look like:
In this case,
assertAll
would change the default strategy employed by theassertThat
method to collect instead of throw.This is great in that it's pretty flexible, but it will add extra nesting.
We could also add
assertSoftly
. Although I don't think I like that name, so maybeassertAllWith(...)
instead:but I wonder if that's even necessary, as the Kotlin-idiomatic thing to do may be to allow users to just use Kotlin directly (the first example) instead of trying to wrap everything ourselves.
The text was updated successfully, but these errors were encountered: