mirror of https://github.com/docker/cli.git
fixed the output leak from daemon unit tests
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
This commit is contained in:
parent
2eac0bb7b7
commit
69b226a89c
|
@ -3,6 +3,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io/ioutil"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -17,6 +18,7 @@ func TestDaemonCommandHelp(t *testing.T) {
|
||||||
cmd := newDaemonCommand()
|
cmd := newDaemonCommand()
|
||||||
cmd.RunE = stubRun
|
cmd.RunE = stubRun
|
||||||
cmd.SetArgs([]string{"--help"})
|
cmd.SetArgs([]string{"--help"})
|
||||||
|
cmd.SetOutput(ioutil.Discard)
|
||||||
err := cmd.Execute()
|
err := cmd.Execute()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
@ -25,6 +27,7 @@ func TestDaemonCommand(t *testing.T) {
|
||||||
cmd := newDaemonCommand()
|
cmd := newDaemonCommand()
|
||||||
cmd.RunE = stubRun
|
cmd.RunE = stubRun
|
||||||
cmd.SetArgs([]string{"--containerd", "/foo"})
|
cmd.SetArgs([]string{"--containerd", "/foo"})
|
||||||
|
cmd.SetOutput(ioutil.Discard)
|
||||||
err := cmd.Execute()
|
err := cmd.Execute()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue