summaryrefslogtreecommitdiff
path: root/command.go
diff options
context:
space:
mode:
authorantichris <[email protected]>2021-04-06 06:46:20 +0300
committerGitHub <[email protected]>2021-04-06 06:46:20 +0300
commit4a17a04514e754aded1594d4125264e1e1976c6b (patch)
tree98777cffc723aa203a5311cb329830ec30a7508e /command.go
parent002575c9d5d6c6e162302512c5b899920e839e56 (diff)
complete: enable complete.Complete() output capturing (#138)
* complete: test capturing Complete() output Implement an Example test to demonstrate capturing the output of Complete(), which is crucial for integration tests. * complete: do not hard-code the I/O streams at the package initialization Instead of defining the input/output streams as unexported global vars that only get their values assigned to once, at the very initialization of the package, use the values that `os.Stdin` and `os.Stdout` have at the particular moment on every `complete.Complete()` call. Fix #137 * complete: capture and discard output in TestComplete Restore earlier behavior using proper stream redirection this time. * complete: output capturing example: define things in the package scope Define the `stringLookup` func type and `promptEnv` func in the package scope instead of the `ExampleComplete_outputCapturing` test. * complete: rename the `stringLookup` func type to `getEnvFn`
Diffstat (limited to 'command.go')
0 files changed, 0 insertions, 0 deletions