Skip to content
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

Missing representation #433

Open
SerVB opened this issue Dec 2, 2022 · 3 comments
Open

Missing representation #433

SerVB opened this issue Dec 2, 2022 · 3 comments

Comments

@SerVB
Copy link

SerVB commented Dec 2, 2022

Hi! I'm comparing assertk to assertj and bumped into innability to find a way to change representations in the assertions message (Assertions.useRepresentation).

Does it exist or is it not yet implemented?

IMO that is quite useful, and should be provided ootb.

@evant
Copy link
Collaborator

evant commented Nov 30, 2023

You can pass a custom display function when calling assertThat
ex:

assertThat(foo, displayActual = { myCustomRepresentation(it) })

this could probably be better documented.

Does this cover the use-cases you are envisioning?

@SerVB
Copy link
Author

SerVB commented Dec 1, 2023

Thanks for the answer. This looks not so convenient, though, to always pass the display function. It's better to just somehow specify globally.

@evant
Copy link
Collaborator

evant commented Dec 1, 2023

Oh you mean specifically a global setting then? Extending how show() works is something I've considered, but doing that in a way that's ergonomic and easy to understand is tricky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants