createTestPRDWithName creates a minimal test PRD file with a given name and returns its path.
(t *testing.T, dir, name string)
| 12 | |
| 13 | // createTestPRDWithName creates a minimal test PRD file with a given name and returns its path. |
| 14 | func createTestPRDWithName(t *testing.T, dir, name string) string { |
| 15 | t.Helper() |
| 16 | |
| 17 | prdDir := filepath.Join(dir, name) |
| 18 | if err := os.MkdirAll(prdDir, 0755); err != nil { |
| 19 | t.Fatal(err) |
| 20 | } |
| 21 | |
| 22 | prdPath := filepath.Join(prdDir, "prd.json") |
| 23 | content := `{ |
| 24 | "project": "Test PRD", |
| 25 | "description": "Test", |
| 26 | "userStories": [ |
| 27 | {"id": "US-001", "title": "Test Story", "description": "Test", "priority": 1, "passes": false} |
| 28 | ] |
| 29 | }` |
| 30 | |
| 31 | if err := os.WriteFile(prdPath, []byte(content), 0644); err != nil { |
| 32 | t.Fatal(err) |
| 33 | } |
| 34 | |
| 35 | return prdPath |
| 36 | } |
| 37 | |
| 38 | func TestNewManager(t *testing.T) { |
| 39 | m := NewManager(10, testProvider) |
no outgoing calls
no test coverage detected