MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestExists

Function TestExists

internal/config/config_test.go:65–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestExists(t *testing.T) {
66 dir := t.TempDir()
67
68 if Exists(dir) {
69 t.Error("expected Exists to return false for missing config")
70 }
71
72 // Create the config
73 chiefDir := filepath.Join(dir, ".chief")
74 if err := os.MkdirAll(chiefDir, 0o755); err != nil {
75 t.Fatal(err)
76 }
77 if err := os.WriteFile(filepath.Join(chiefDir, "config.yaml"), []byte("{}"), 0o644); err != nil {
78 t.Fatal(err)
79 }
80
81 if !Exists(dir) {
82 t.Error("expected Exists to return true for existing config")
83 }
84}

Callers

nothing calls this directly

Calls 1

ExistsFunction · 0.85

Tested by

no test coverage detected