MCPcopy
hub / github.com/roboll/helmfile / NewTestFs

Function NewTestFs

pkg/testhelper/testfs.go:21–38  ·  view source on GitHub ↗
(files map[string]string)

Source from the content-addressed store, hash-verified

19}
20
21func NewTestFs(files map[string]string) *TestFs {
22 dirs := map[string]bool{}
23 for abs := range files {
24 for d := filepath.ToSlash(filepath.Dir(abs)); !dirs[d]; d = filepath.ToSlash(filepath.Dir(d)) {
25 dirs[d] = true
26 fmt.Fprintf(os.Stderr, "testfs: recognized dir: %s\n", d)
27 }
28 }
29 return &TestFs{
30 Cwd: "/path/to",
31 dirs: dirs,
32 files: files,
33
34 successfulReads: []string{},
35
36 GlobFixtures: map[string][]string{},
37 }
38}
39
40func (f *TestFs) FileExistsAt(path string) bool {
41 var ok bool

Calls

no outgoing calls