mirror of https://github.com/docker/cli.git
839dbbcf27
When running tests from my IDE, it compiles the tests before running, then executes the compiled binary to run the tests. Cobra doesn't like that, because in that situation os.Args is taken as argument for the command that's executed. The command that's tested now sees the `test-` flags as arguments (`-test.v -test.run ..`), which causes various tests to fail ("Command XYZ does not accept arguments"). # compile the tests: go test -c -o foo.test # execute the test: ./foo.test -test.v -test.run TestFoo === RUN TestFoo Error: "foo" accepts no arguments. Set arguments to an empty slice to make sure it doesn't inherit arguments from the test-binary. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> |
||
---|---|---|
.. | ||
command | ||
compose | ||
config | ||
connhelper | ||
context | ||
debug | ||
flags | ||
hints | ||
internal/oauth | ||
manifest | ||
registry/client | ||
streams | ||
trust | ||
version | ||
winresources | ||
cobra.go | ||
cobra_test.go | ||
error.go | ||
required.go | ||
required_test.go |