1
0
mirror of https://github.com/go-task/task.git synced 2025-01-04 03:48:02 +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, "")
}

12
testdata/details/Taskfile.yml vendored Normal file
View File

@ -0,0 +1,12 @@
version: 2
tasks:
task-with-details:
details: |
This is a very long detailed description
with multiple lines
cmds:
- exit 0
task-without-details:
cmds:
- exit 0