Skip to content

How to adjust string representations #1262

Answered by robstoll
SerVB asked this question in Q&A
Discussion options

You must be logged in to vote

It's not hard-coded and its possible to exchange the current implementation with yours. You need to replace the current implementation of ch.tutteli.atrium.reporting.text.TextObjectFormatter with your own implementation.
If you want that only for one use case then you can use

expect(...).withOptions {
  withComponent(ObjectFormatter::class) { c -> ReadmeObjectFormatter(c.build()) }
}.toEqual("Another string")

If you intend to exchange it all the time then I suggest you use your own expectation verb: https://github.com/robstoll/atrium#use-own-expectation-verb see also readme.examples.OwnExpectationVerbSpec for an example.

just as info, I started refactoring the output and there we won't s…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@SerVB
Comment options

@SerVB
Comment options

@robstoll
Comment options

@SerVB
Comment options

@robstoll
Comment options

Answer selected by robstoll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants