mirror of
https://github.com/go-task/task.git
synced 2025-11-27 22:38:20 +02:00
add more tests for details
This commit is contained in:
16
task_test.go
16
task_test.go
@@ -563,8 +563,22 @@ func TestDetails(t *testing.T) {
|
||||
Stdout: &buff,
|
||||
Stderr: &buff,
|
||||
Details: true,
|
||||
Silent: true,
|
||||
}
|
||||
assert.NoError(t, e.Setup())
|
||||
assert.Equal(t, e.Taskfile.Tasks["task-with-details"].Details, "This is a very long detailed description\nwith multiple lines\n")
|
||||
const longDetails = "This is a very long detailed description\nwith multiple lines\n"
|
||||
assert.Equal(t, e.Taskfile.Tasks["task-with-details"].Details, longDetails)
|
||||
const shortDetails = "short details"
|
||||
assert.Equal(t, e.Taskfile.Tasks["other-task-with-details"].Details, shortDetails)
|
||||
assert.Equal(t, e.Taskfile.Tasks["task-without-details"].Details, "")
|
||||
|
||||
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: "task-with-details"}))
|
||||
assert.NotContains(t, buff.String(), "task-with-details was executed")
|
||||
assert.NotContains(t, buff.String(), "dependend-task was executed")
|
||||
assert.Contains(t, buff.String(), longDetails)
|
||||
|
||||
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: "task-without-details"}))
|
||||
assert.NotContains(t, buff.String(), "task-without-details was executed")
|
||||
assert.NotContains(t, buff.String(), "dependend-task was executed")
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user