From 800d9006883228365a375800254871397cb1a011 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Thu, 27 Jun 2013 15:25:31 -0700 Subject: [PATCH] Ignore stderr while doing tests --- commands.go | 2 +- commands_test.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/commands.go b/commands.go index 3ce8c8eb98..dda7f13d46 100644 --- a/commands.go +++ b/commands.go @@ -1270,7 +1270,7 @@ func (cli *DockerCli) CmdRun(args ...string) error { } for _, warning := range runResult.Warnings { - fmt.Fprintln(cli.err, "WARNING: ", warning) + fmt.Fprintf(cli.err, "WARNING: %s\n", warning) } //start the container diff --git a/commands_test.go b/commands_test.go index 87c4c02a52..483c5e70c9 100644 --- a/commands_test.go +++ b/commands_test.go @@ -132,11 +132,12 @@ func TestImages(t *testing.T) { } */ + // TestRunHostname checks that 'docker run -h' correctly sets a custom hostname func TestRunHostname(t *testing.T) { stdout, stdoutPipe := io.Pipe() - cli := NewDockerCli(nil, stdoutPipe, nil, testDaemonProto, testDaemonAddr) + cli := NewDockerCli(nil, stdoutPipe, ioutil.Discard, testDaemonProto, testDaemonAddr) defer cleanup(globalRuntime) c := make(chan struct{}) @@ -329,7 +330,7 @@ func TestRunAttachStdin(t *testing.T) { stdin, stdinPipe := io.Pipe() stdout, stdoutPipe := io.Pipe() - cli := NewDockerCli(stdin, stdoutPipe, nil, testDaemonProto, testDaemonAddr) + cli := NewDockerCli(stdin, stdoutPipe, ioutil.Discard, testDaemonProto, testDaemonAddr) defer cleanup(globalRuntime) ch := make(chan struct{})