1
0
mirror of https://github.com/go-task/task.git synced 2025-01-26 05:27:15 +02:00

hides commands keywoard if not present

This commit is contained in:
jaedle 2019-02-24 17:12:22 +01:00
parent 474f27c6d3
commit 890996f595

View File

@ -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")
}