MCPcopy
hub / github.com/go-task/task / TestInitDir

Function TestInitDir

init_test.go:11–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func 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
33func TestInitFile(t *testing.T) {
34 t.Parallel()

Callers

nothing calls this directly

Calls 2

SmartJoinFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…