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

Function TestRunNewRejectsExistingPRD

internal/cmd/new_test.go:132–154  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

130}
131
132func TestRunNewRejectsExistingPRD(t *testing.T) {
133 tmpDir := t.TempDir()
134
135 // Create existing prd.md
136 prdDir := filepath.Join(tmpDir, ".chief", "prds", "existing")
137 if err := os.MkdirAll(prdDir, 0755); err != nil {
138 t.Fatalf("Failed to create directory: %v", err)
139 }
140 prdMdPath := filepath.Join(prdDir, "prd.md")
141 if err := os.WriteFile(prdMdPath, []byte("# Existing PRD"), 0644); err != nil {
142 t.Fatalf("Failed to create prd.md: %v", err)
143 }
144
145 opts := NewOptions{
146 Name: "existing",
147 BaseDir: tmpDir,
148 }
149
150 err := RunNew(opts)
151 if err == nil {
152 t.Error("Expected error for existing PRD")
153 }
154}
155
156func TestRunNewRequiresProvider(t *testing.T) {
157 opts := NewOptions{

Callers

nothing calls this directly

Calls 1

RunNewFunction · 0.85

Tested by

no test coverage detected