1
0
mirror of https://github.com/go-task/task.git synced 2025-01-14 04:35:50 +02:00

be more specific in tests about output

This commit is contained in:
jaedle 2019-02-24 11:28:15 +01:00
parent 5a23250d32
commit 0164bc21ea
2 changed files with 2 additions and 3 deletions

View File

@ -84,6 +84,7 @@ func (e *Executor) displayTaskDetails(task string) {
if e.Taskfile.Tasks[task].Details == "" {
e.Logger.Errf("task: There is no detailed description for task: %s", task)
} else {
e.Logger.Outf(e.Taskfile.Tasks[task].Details)
}
}

View File

@ -582,9 +582,7 @@ func TestDetails(t *testing.T) {
buff.Reset()
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: "task-with-details"}))
assert.Contains(t, buff.String(), "details of task-with-details - line 1")
assert.Contains(t, buff.String(), "line 2")
assert.Contains(t, buff.String(), "line 3")
assert.Equal(t, buff.String(), "details of task-with-details - line 1\n"+"line 2\n"+"line 3\n\n")
assert.NotContains(t, buff.String(), "task-with-details was executed")
assert.NotContains(t, buff.String(), "dependend-task was executed")