docker-cli/cli/command/stack/deploy_test.go
Sebastiaan van Stijn 719169db63
Replace deprecated Cobra command.SetOutput() with command.SetOut()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-07 14:25:59 +02:00

18 lines
358 B
Go

package stack
import (
"io/ioutil"
"testing"
"github.com/docker/cli/internal/test"
"gotest.tools/v3/assert"
)
func TestDeployWithEmptyName(t *testing.T) {
cmd := newDeployCommand(test.NewFakeCli(&fakeClient{}), nil)
cmd.SetArgs([]string{"' '"})
cmd.SetOut(ioutil.Discard)
assert.ErrorContains(t, cmd.Execute(), `invalid stack name: "' '"`)
}