commands: add missing noTabs test

This commit is contained in:
Frank Schroeder 2017-10-17 14:07:30 +02:00 committed by Frank Schröder
parent a6d912adb4
commit a1a1a6971d
4 changed files with 28 additions and 0 deletions

View File

@ -25,6 +25,13 @@ func argFail(t *testing.T, args []string, expected string) {
} }
func TestLockCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestLockCommand_BadArgs(t *testing.T) { func TestLockCommand_BadArgs(t *testing.T) {
t.Parallel() t.Parallel()
argFail(t, []string{"-try=blah", "test/prefix", "date"}, "invalid duration") argFail(t, []string{"-try=blah", "test/prefix", "date"}, "invalid duration")

View File

@ -9,6 +9,13 @@ import (
"github.com/mitchellh/cli" "github.com/mitchellh/cli"
) )
func TestMaintCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestMaintCommand_ConflictingArgs(t *testing.T) { func TestMaintCommand_ConflictingArgs(t *testing.T) {
t.Parallel() t.Parallel()
ui := cli.NewMockUi() ui := cli.NewMockUi()

View File

@ -9,6 +9,13 @@ import (
"github.com/mitchellh/cli" "github.com/mitchellh/cli"
) )
func TestMembersCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestMembersCommand(t *testing.T) { func TestMembersCommand(t *testing.T) {
t.Parallel() t.Parallel()
a := agent.NewTestAgent(t.Name(), ``) a := agent.NewTestAgent(t.Name(), ``)

View File

@ -8,6 +8,13 @@ import (
"github.com/mitchellh/cli" "github.com/mitchellh/cli"
) )
func TestWatchCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi(), nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestWatchCommand(t *testing.T) { func TestWatchCommand(t *testing.T) {
t.Parallel() t.Parallel()
a := agent.NewTestAgent(t.Name(), ``) a := agent.NewTestAgent(t.Name(), ``)