Closed dnagir closed 3 months ago
It is useful to test the help output for the non-trivial CLIs and in the environment where an example outputs are desired.
Before this, testing for help required resorting to os/exec.
os/exec
After this, the consumer test can swap the cli.Stderr for testing purposes while not affecting any other details of the mow.cli.
cli.Stderr
mow.cli
The stdOut is not published as it is only used internally for testing and has no impact on consumers as mow.cli never prints to STDOUT.
stdOut
NOTE: alternative implementation exists but has a larger "blast radius".
It is useful to test the help output for the non-trivial CLIs and in the environment where an example outputs are desired.
Before this, testing for help required resorting to
os/exec
.After this, the consumer test can swap the
cli.Stderr
for testing purposes while not affecting any other details of themow.cli
.The
stdOut
is not published as it is only used internally for testing and has no impact on consumers asmow.cli
never prints to STDOUT.NOTE: alternative implementation exists but has a larger "blast radius".