fix(778): git bug rm broken by smoyer64 · Pull Request #808 · git-bug/git-bug
@MichaelMure - I actually wanted to talk about the use of "golden files" (as described by Mitchell Hashimoto's "Advanced Testing with Go") in git-bug tests. Using this technique may not be worthwhile as I'm not sure that it's applicable to any of the operations except the various help output. Other commands commonly return output that includes hash prefixes, so they won't be consistent.
The benefit of this type of test is that it will flag any time the help output changes and presumably the developer would either fix the code that caused the change or run the test with the -update flag so that the new output was the expected value. The downside is that, if the text output by help commands changed frequently, it might feel onerous to repeatedly run the update command.
The test failure on Windows is due to the differences in line termination characters - I'll fix this (and address printing the output as strings) to make sure the tests actually complete successfully, then will move on to addressing your other comments. At some point, we'll also need to redirect stdin (for testing commands that can be interactive) and there are a few places that produce output without using env.err or env.out.
Finally, I was wondering why the user_create command outputs to both env.err and env.out on success - https://github.com/MichaelMure/git-bug/blob/dd8134b638508fb712c116d6733ed1f4437d1b67/commands/user_create.go#L93.