(t *testing.T)
| 163 | } |
| 164 | |
| 165 | func 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 | |
| 187 | func TestAdd_JSONOutput(t *testing.T) { |
| 188 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected