Allow shorter syntax for tasks with default configuration

Closes #194
Closes #240

Co-authored-by: Jaedle <dennis.jekubczyk@gmail.com>
This commit is contained in:
Andrey Nering
2019-12-07 21:28:02 -03:00
parent b7bcd204b4
commit b7b752b92f
6 changed files with 113 additions and 9 deletions

View File

@@ -684,3 +684,18 @@ func TestDisplaysErrorOnUnsupportedVersion(t *testing.T) {
assert.Equal(t, "task: Taskfile versions prior to v2 are not supported anymore", err.Error())
}
func TestShortTaskNotation(t *testing.T) {
const dir = "testdata/short_task_notation"
var buff bytes.Buffer
e := task.Executor{
Dir: dir,
Stdout: &buff,
Stderr: &buff,
Silent: true,
}
assert.NoError(t, e.Setup())
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: "default"}))
assert.Equal(t, "string-slice-1\nstring-slice-2\nstring\n", buff.String())
}