---------- project path ----------
(t *testing.T)
| 332 | // ---------- project path ---------- |
| 333 | |
| 334 | func TestCmdShowProjectHappyPath(t *testing.T) { |
| 335 | root, db := showListEditDB(t) |
| 336 | insertProject(t, db, "biglift", "Big Lift", filepath.Join(root, "repo"), "high") |
| 337 | insertTask(t, db, "bl-one", "One", "in-progress", "medium", filepath.Join(root, "repo"), "biglift") |
| 338 | insertTask(t, db, "bl-two", "Two", "backlog", "low", filepath.Join(root, "repo"), "biglift") |
| 339 | insertTask(t, db, "bl-three", "Three", "done", "low", filepath.Join(root, "repo"), "biglift") |
| 340 | out := captureStdout(t, func() { |
| 341 | if rc := cmdShow([]string{"project", "biglift"}); rc != 0 { |
| 342 | t.Errorf("rc=%d", rc) |
| 343 | } |
| 344 | }) |
| 345 | if !strings.Contains(out, "slug: biglift") { |
| 346 | t.Errorf("missing slug; out=%q", out) |
| 347 | } |
| 348 | if !strings.Contains(out, "3 total") { |
| 349 | t.Errorf("missing total count; out=%q", out) |
| 350 | } |
| 351 | if !strings.Contains(out, "1 in-progress, 1 backlog, 1 done") { |
| 352 | t.Errorf("missing breakdown; out=%q", out) |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | func TestCmdShowProjectDefaultsFromEnv(t *testing.T) { |
| 357 | root, db := showListEditDB(t) |
nothing calls this directly
no test coverage detected