Skip to content

Commit

Permalink
Rename tests
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <[email protected]>
  • Loading branch information
dgageot committed May 27, 2019
1 parent 953ad84 commit 7ad40f7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/skaffold/app/cmd/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@ import (
"github.com/GoogleContainerTools/skaffold/testutil"
)

func TestNewCommandDescription(t *testing.T) {
func TestNewCmdDescription(t *testing.T) {
cmd := NewCmd(nil, "help").WithDescription("prints help").NoArgs(nil)

testutil.CheckDeepEqual(t, "help", cmd.Use)
testutil.CheckDeepEqual(t, "prints help", cmd.Short)
}

func TestNewCommandLongDescription(t *testing.T) {
func TestNewCmdLongDescription(t *testing.T) {
cmd := NewCmd(nil, "help").WithLongDescription("long description").NoArgs(nil)

testutil.CheckDeepEqual(t, "help", cmd.Use)
testutil.CheckDeepEqual(t, "long description", cmd.Long)
}

func TestNewCommandNoArgs(t *testing.T) {
func TestNewCmdNoArgs(t *testing.T) {
cmd := NewCmd(nil, "").NoArgs(nil)

testutil.CheckError(t, false, cmd.Args(cmd, []string{}))
testutil.CheckError(t, true, cmd.Args(cmd, []string{"extract arg"}))
}

func TestNewCommandExactArgs(t *testing.T) {
func TestNewCmdExactArgs(t *testing.T) {
cmd := NewCmd(nil, "").ExactArgs(1, nil)

testutil.CheckError(t, true, cmd.Args(cmd, []string{}))
testutil.CheckError(t, false, cmd.Args(cmd, []string{"valid"}))
testutil.CheckError(t, true, cmd.Args(cmd, []string{"valid", "extra"}))
}

func TestNewCommandError(t *testing.T) {
func TestNewCmdError(t *testing.T) {
cmd := NewCmd(nil, "").NoArgs(func(out io.Writer) error {
return errors.New("expected error")
})
Expand All @@ -65,7 +65,7 @@ func TestNewCommandError(t *testing.T) {
testutil.CheckErrorAndDeepEqual(t, true, err, "expected error", err.Error())
}

func TestNewCommandOutput(t *testing.T) {
func TestNewCmdOutput(t *testing.T) {
var buf bytes.Buffer

cmd := NewCmd(&buf, "").ExactArgs(1, func(out io.Writer, args []string) error {
Expand Down

0 comments on commit 7ad40f7

Please sign in to comment.