diff --git a/internal/summary/summary_test.go b/internal/summary/summary_test.go index 8ea4b1bb..872d8dcf 100644 --- a/internal/summary/summary_test.go +++ b/internal/summary/summary_test.go @@ -102,3 +102,40 @@ func TestDoesNotPrintCommandIfMissing(t *testing.T) { assert.NotContains(t, buffer.String(), "commands") } + +func TestFullSummary(t *testing.T) { + buffer := &bytes.Buffer{} + l := logger.Logger{ + Stdout: buffer, + Stderr: buffer, + Verbose: false, + } + task := &taskfile.Task{ + Task: "sample-task", + Summary: "line1\nline2\nline3\n", + Deps: []*taskfile.Dep{ + {Task: "dependency"}, + }, + Cmds: []*taskfile.Cmd{ + {Cmd: "command"}, + }, + } + + summary.Print(&l, task) + + expected := + `task: sample-task + +line1 +line2 +line3 + +dependencies: + - dependency + +commands: + - command +` + + assert.Equal(t, expected, buffer.String()) +}