1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

Add Taskfile struct and start implementing new format

Updates #54, #66 and #77
This commit is contained in:
Andrey Nering
2017-12-29 18:27:32 -02:00
parent 00ff1447ee
commit 134c6b79c4
8 changed files with 93 additions and 24 deletions

View File

@@ -347,3 +347,26 @@ func TestCyclicDep(t *testing.T) {
assert.NoError(t, e.ReadTaskfile())
assert.IsType(t, &task.MaximumTaskCallExceededError{}, e.Run(task.Call{Task: "task-1"}))
}
func TestTaskVersion(t *testing.T) {
tests := []struct {
Dir string
Version int
}{
{"testdata/version/v1", 1},
{"testdata/version/v2", 2},
}
for _, test := range tests {
t.Run(test.Dir, func(t *testing.T) {
e := task.Executor{
Dir: test.Dir,
Stdout: ioutil.Discard,
Stderr: ioutil.Discard,
}
assert.NoError(t, e.ReadTaskfile())
assert.Equal(t, test.Version, e.Taskfile.Version)
assert.Equal(t, 2, len(e.Taskfile.Tasks))
})
}
}