createMockClaudeScript creates a shell script that outputs predefined stream-json.
(t *testing.T, dir string, output []string)
| 46 | |
| 47 | // createMockClaudeScript creates a shell script that outputs predefined stream-json. |
| 48 | func createMockClaudeScript(t *testing.T, dir string, output []string) string { |
| 49 | t.Helper() |
| 50 | |
| 51 | scriptPath := filepath.Join(dir, "mock-claude") |
| 52 | content := "#!/bin/bash\n" |
| 53 | for _, line := range output { |
| 54 | content += "echo '" + line + "'\n" |
| 55 | } |
| 56 | |
| 57 | if err := os.WriteFile(scriptPath, []byte(content), 0755); err != nil { |
| 58 | t.Fatalf("Failed to create mock script: %v", err) |
| 59 | } |
| 60 | |
| 61 | return scriptPath |
| 62 | } |
| 63 | |
| 64 | // createTestPRD creates a minimal test PRD markdown file. |
| 65 | func createTestPRD(t *testing.T, dir string, allComplete bool) string { |
no outgoing calls
no test coverage detected