(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestInitDir(t *testing.T) { |
| 12 | t.Parallel() |
| 13 | |
| 14 | const dir = "testdata/init" |
| 15 | file := filepathext.SmartJoin(dir, "Taskfile.yml") |
| 16 | |
| 17 | _ = os.Remove(file) |
| 18 | if _, err := os.Stat(file); err == nil { |
| 19 | t.Errorf("Taskfile.yml should not exist") |
| 20 | } |
| 21 | |
| 22 | if _, err := task.InitTaskfile(dir); err != nil { |
| 23 | t.Error(err) |
| 24 | } |
| 25 | |
| 26 | if _, err := os.Stat(file); err != nil { |
| 27 | t.Errorf("Taskfile.yml should exist") |
| 28 | } |
| 29 | |
| 30 | _ = os.Remove(file) |
| 31 | } |
| 32 | |
| 33 | func TestInitFile(t *testing.T) { |
| 34 | t.Parallel() |