Skip to content

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

@aneveux

Description

@aneveux

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions