mirror of
https://github.com/go-task/task.git
synced 2025-08-10 22:42:19 +02:00
hides commands keywoard if not present
This commit is contained in:
@@ -86,3 +86,19 @@ func TestPrintTaskCommandsIfPresent(t *testing.T) {
|
||||
assert.Contains(t, buffer.String(), "\n - command-2\n")
|
||||
assert.Contains(t, buffer.String(), "\n - command-3\n")
|
||||
}
|
||||
|
||||
func TestDoesNotPrintCommandIfMissing(t *testing.T) {
|
||||
buffer := &bytes.Buffer{}
|
||||
l := logger.Logger{
|
||||
Stdout: buffer,
|
||||
Stderr: buffer,
|
||||
Verbose: false,
|
||||
}
|
||||
task := &taskfile.Task{
|
||||
Cmds: []*taskfile.Cmd{},
|
||||
}
|
||||
|
||||
summary.Print(&l, task)
|
||||
|
||||
assert.NotContains(t, buffer.String(), "commands")
|
||||
}
|
||||
|
Reference in New Issue
Block a user