1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

Change error output

This commit is contained in:
Stephen Prater
2019-06-11 12:20:56 -07:00
parent d1463b3e24
commit cc9264854e
3 changed files with 5 additions and 9 deletions

View File

@@ -293,7 +293,7 @@ func TestPrecondition(t *testing.T) {
// A precondition that was not met
assert.Error(t, e.Run(context.Background(), taskfile.Call{Task: "impossible"}))
if buff.String() != "1 != 0\n" {
if buff.String() != "task: 1 != 0 obviously!\n" {
t.Errorf("Wrong output message: %s", buff.String())
}
buff.Reset()
@@ -301,14 +301,14 @@ func TestPrecondition(t *testing.T) {
// Calling a task with a precondition in a dependency fails the task
assert.Error(t, e.Run(context.Background(), taskfile.Call{Task: "depends_on_imposssible"}))
if buff.String() != "1 != 0\ntask: precondition not met\n" {
if buff.String() != "task: 1 != 0 obviously!\n" {
t.Errorf("Wrong output message: %s", buff.String())
}
buff.Reset()
// Calling a task with a precondition in a cmd fails the task
assert.Error(t, e.Run(context.Background(), taskfile.Call{Task: "executes_failing_task_as_cmd"}))
if buff.String() != "1 != 0\ntask: precondition not met\n" {
if buff.String() != "task: 1 != 0 obviously!\n" {
t.Errorf("Wrong output message: %s", buff.String())
}
buff.Reset()