MCPcopy Create free account
hub / github.com/driangle/taskmd / TestAdd_GroupFlag

Function TestAdd_GroupFlag

apps/cli/internal/cli/add_test.go:165–185  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func TestAdd_GroupFlag(t *testing.T) {
166 tmpDir := t.TempDir()
167 resetAddFlags()
168 taskDir = tmpDir
169 addGroup = "cli"
170
171 output, err := captureAddOutput(t, "CLI task")
172 if err != nil {
173 t.Fatalf("unexpected error: %v", err)
174 }
175
176 // Verify file created in subdirectory
177 files, _ := filepath.Glob(filepath.Join(tmpDir, "cli", "001-*.md"))
178 if len(files) != 1 {
179 t.Fatalf("expected 1 file in cli/, got %d", len(files))
180 }
181
182 if !strings.Contains(output, filepath.Join("cli", "001-")) {
183 t.Errorf("expected path with cli/ in output, got: %s", output)
184 }
185}
186
187func TestAdd_JSONOutput(t *testing.T) {
188 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 2

resetAddFlagsFunction · 0.85
captureAddOutputFunction · 0.85

Tested by

no test coverage detected