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

Possibility to call another task

This commit is contained in:
Andrey Nering
2017-03-25 15:26:42 -03:00
parent 0db3e9a05d
commit 59306cda38
5 changed files with 87 additions and 5 deletions

View File

@@ -85,3 +85,30 @@ func TestVars(t *testing.T) {
}
}
}
func TestTaskCall(t *testing.T) {
const dir = "testdata/task_call"
files := []string{
"foo.txt",
"bar.txt",
}
for _, f := range files {
_ = os.Remove(filepath.Join(dir, f))
}
c := exec.Command("task")
c.Dir = dir
if err := c.Run(); err != nil {
t.Error(err)
return
}
for _, f := range files {
if _, err := os.Stat(filepath.Join(dir, f)); err != nil {
t.Error(err)
}
}
}