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

add basic test for details

This commit is contained in:
jaedle
2019-02-24 09:53:49 +01:00
parent 5c823d51d0
commit f9adeba7f1
2 changed files with 27 additions and 0 deletions

View File

@@ -553,3 +553,18 @@ func TestIncludesCallingRoot(t *testing.T) {
}
tt.Run(t)
}
func TestDetails(t *testing.T) {
const dir = "testdata/details"
var buff bytes.Buffer
e := task.Executor{
Dir: dir,
Stdout: &buff,
Stderr: &buff,
Details: 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")
assert.Equal(t, e.Taskfile.Tasks["task-without-details"].Details, "")
}