This command was declaring that it requires at least 1 argument, when it needs exactly 1 argument. This was causing the CLI to panic when the command was invoked with no argument: `docker volume update` Signed-off-by: Laura Brehm <laurabrehm@hey.com>
23 lines
361 B
Go
23 lines
361 B
Go
package volume
|
|
|
|
import (
|
|
"io"
|
|
"testing"
|
|
|
|
"github.com/docker/cli/internal/test"
|
|
"gotest.tools/v3/assert"
|
|
)
|
|
|
|
func TestUpdateCmd(t *testing.T) {
|
|
cmd := newUpdateCommand(
|
|
test.NewFakeCli(&fakeClient{}),
|
|
)
|
|
cmd.SetArgs([]string{})
|
|
cmd.SetOut(io.Discard)
|
|
cmd.SetErr(io.Discard)
|
|
|
|
err := cmd.Execute()
|
|
|
|
assert.ErrorContains(t, err, "requires 1 argument")
|
|
}
|