mirror of https://github.com/docker/cli.git
Merge pull request #1141 from adshmh/fix-output-leak-from-TestRunCommandWithContentTrustErrors
fixed output leak from TestRunCommandWithContentTrustErrors
This commit is contained in:
commit
1c20e3f601
|
@ -2,6 +2,7 @@ package container
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/docker/cli/internal/test"
|
"github.com/docker/cli/internal/test"
|
||||||
|
@ -66,6 +67,7 @@ func TestRunCommandWithContentTrustErrors(t *testing.T) {
|
||||||
cli.SetNotaryClient(tc.notaryFunc)
|
cli.SetNotaryClient(tc.notaryFunc)
|
||||||
cmd := NewRunCommand(cli)
|
cmd := NewRunCommand(cli)
|
||||||
cmd.SetArgs(tc.args)
|
cmd.SetArgs(tc.args)
|
||||||
|
cmd.SetOutput(ioutil.Discard)
|
||||||
err := cmd.Execute()
|
err := cmd.Execute()
|
||||||
assert.Assert(t, err != nil)
|
assert.Assert(t, err != nil)
|
||||||
assert.Assert(t, is.Contains(cli.ErrBuffer().String(), tc.expectedError))
|
assert.Assert(t, is.Contains(cli.ErrBuffer().String(), tc.expectedError))
|
||||||
|
|
Loading…
Reference in New Issue