Browse code

Fix TestDiffEmptyArgClientError O:)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Vincent Demeester authored on 2016/06/06 20:58:29
Showing 2 changed files
... ...
@@ -34,6 +34,9 @@ func NewDiffCommand(dockerCli *client.DockerCli) *cobra.Command {
34 34
 }
35 35
 
36 36
 func runDiff(dockerCli *client.DockerCli, opts *diffOptions) error {
37
+	if opts.container == "" {
38
+		return fmt.Errorf("Container name cannot be empty")
39
+	}
37 40
 	ctx := context.Background()
38 41
 
39 42
 	changes, err := dockerCli.Client().ContainerDiff(ctx, opts.container)
... ...
@@ -83,5 +83,5 @@ func (s *DockerSuite) TestDiffEnsureDefaultDevs(c *check.C) {
83 83
 func (s *DockerSuite) TestDiffEmptyArgClientError(c *check.C) {
84 84
 	out, _, err := dockerCmdWithError("diff", "")
85 85
 	c.Assert(err, checker.NotNil)
86
-	c.Assert(strings.TrimSpace(out), checker.Contains, "\"docker diff\" requires exactly 1 argument(s).")
86
+	c.Assert(strings.TrimSpace(out), checker.Contains, "Container name cannot be empty")
87 87
 }