mirror of
https://github.com/go-task/task.git
synced 2025-01-12 04:34:11 +02:00
add unit test for full output
This commit is contained in:
parent
890996f595
commit
a4a20d92a4
@ -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())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user