mirror of
https://github.com/go-task/task.git
synced 2025-12-16 19:57:43 +01:00
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:
15
task_test.go
15
task_test.go
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user