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

Allow to use a specific formatter while computing verification of a particular object #13

Open
2 tasks
aneveux opened this issue Feb 26, 2018 · 0 comments
Open
2 tasks

Comments

@aneveux
Copy link
Member

aneveux commented Feb 26, 2018

As per now, the framework relies on a toString call from the object under verification so it can be written in a file.

In some cases, that might not be convenient (if the toString method is already used for something else, or not providing the information you'd like). The framework should allow to specify a formatter function for that.

For example:

Approvals.verify(anObject, { o -> o.aField + " - " + o.anotherField });

Should allow to format the output not calling toString from the provided object, but calling the formatter function instead.

  • format Map (order keys, one key/value per line)
  • format collections (one entry per line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant