Fix TestDiffEmptyArgClientError O:)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2016-06-06 13:58:29 +02:00
parent 9d2e8abd30
commit 7878705dcc
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3
2 changed files with 4 additions and 1 deletions

View file

@ -34,6 +34,9 @@ func NewDiffCommand(dockerCli *client.DockerCli) *cobra.Command {
}
func runDiff(dockerCli *client.DockerCli, opts *diffOptions) error {
if opts.container == "" {
return fmt.Errorf("Container name cannot be empty")
}
ctx := context.Background()
changes, err := dockerCli.Client().ContainerDiff(ctx, opts.container)

View file

@ -83,5 +83,5 @@ func (s *DockerSuite) TestDiffEnsureDefaultDevs(c *check.C) {
func (s *DockerSuite) TestDiffEmptyArgClientError(c *check.C) {
out, _, err := dockerCmdWithError("diff", "")
c.Assert(err, checker.NotNil)
c.Assert(strings.TrimSpace(out), checker.Contains, "\"docker diff\" requires exactly 1 argument(s).")
c.Assert(strings.TrimSpace(out), checker.Contains, "Container name cannot be empty")
}