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

Function TestRunListWithPRDs

internal/cmd/status_test.go:100–136  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestRunListWithPRDs(t *testing.T) {
101 tmpDir := t.TempDir()
102
103 prds := []struct {
104 name string
105 md string
106 }{
107 {
108 "auth",
109 "# Authentication\n\n### US-001: Login\n**Status:** done\n- [x] Works\n\n### US-002: Logout\n- [ ] Works\n",
110 },
111 {
112 "api",
113 "# API Service\n\n### US-001: Endpoints\n**Status:** done\n- [x] Done\n\n### US-002: Auth\n**Status:** done\n- [x] Done\n\n### US-003: Rate limiting\n**Status:** done\n- [x] Done\n",
114 },
115 }
116
117 for _, p := range prds {
118 prdDir := filepath.Join(tmpDir, ".chief", "prds", p.name)
119 if err := os.MkdirAll(prdDir, 0755); err != nil {
120 t.Fatalf("Failed to create directory: %v", err)
121 }
122 prdPath := filepath.Join(prdDir, "prd.md")
123 if err := os.WriteFile(prdPath, []byte(p.md), 0644); err != nil {
124 t.Fatalf("Failed to create prd.md: %v", err)
125 }
126 }
127
128 opts := ListOptions{
129 BaseDir: tmpDir,
130 }
131
132 err := RunList(opts)
133 if err != nil {
134 t.Errorf("RunList() returned error: %v", err)
135 }
136}
137
138func TestRunListSkipsInvalidPRDs(t *testing.T) {
139 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 1

RunListFunction · 0.85

Tested by

no test coverage detected