majohn-r / output

Go library to provide an easy way for command-line oriented programs to handle console and error writing and logging, as well as a simple way to verify what is written to those channels.
MIT License
0 stars 0 forks source link

Add code to perform common Recorder handling #16

Closed majohn-r closed 5 months ago

majohn-r commented 5 months ago

Consuming tests are filled with code like this:

            if differences, verified := o.Verify(tt.WantedRecording); !verified {
                for _, difference := range differences {
                    t.Errorf("AboutRun() %s", difference)
                }
            }

This issue is to produce a new *Recorder function, Report that could be called like this:

            o.Report(t, "AboutRun()", tt.WantedRecording)