Currently, the goss add command does a great job at capturing by default an array of trimmed strings to match. But this can not be used for approval testing commands that produce yaml.
Describe the solution you'd like
A new --exact-match option to "goss add command" to perform exact multi-line matches
Describe alternatives you've considered
wrap goss add with a script which would replace using yq the command.cmd.stdout
Describe the feature:
Enable
goss add command
to capture stdout/stderr as a multiline scriptThis enables to capture & then validate various multiline outputs that are sensitive to space and linefeed (typically yaml output).
This is useful in the test approach sometimes called golden master testing / approval testing/ Characterization tests see https://en.wikipedia.org/wiki/Characterization_test
Here is a sample library that that supports such practice https://approvaltests.com/
Currently, the
goss add command
does a great job at capturing by default an array of trimmed strings to match. But this can not be used for approval testing commands that produce yaml.Describe the solution you'd like
A new --exact-match option to "goss add command" to perform exact multi-line matches
Describe alternatives you've considered
wrap
goss add
with a script which would replace using yq thecommand.cmd.stdout