(t *testing.T)
| 209 | } |
| 210 | |
| 211 | func TestCmdEditProjectOnlyByDefault(t *testing.T) { |
| 212 | root, db := showListEditDB(t) |
| 213 | insertProject(t, db, "soloProj", "S", filepath.Join(root, "x"), "medium") |
| 214 | briefPath := filepath.Join(root, "projects", "soloProj", "brief.md") |
| 215 | if err := os.MkdirAll(filepath.Dir(briefPath), 0o755); err != nil { |
| 216 | t.Fatal(err) |
| 217 | } |
| 218 | if err := os.WriteFile(briefPath, []byte("."), 0o644); err != nil { |
| 219 | t.Fatal(err) |
| 220 | } |
| 221 | script := writeFakeEditor(t, t.TempDir()) |
| 222 | os.Setenv("EDITOR", script) |
| 223 | t.Cleanup(func() { os.Unsetenv("EDITOR") }) |
| 224 | |
| 225 | out := captureStdout(t, func() { |
| 226 | if rc := cmdEdit([]string{"soloProj"}); rc != 0 { |
| 227 | t.Errorf("rc=%d", rc) |
| 228 | } |
| 229 | }) |
| 230 | if !strings.Contains(out, "Edited project soloProj") { |
| 231 | t.Errorf("out=%q", out) |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | func TestCmdEditPlaybook(t *testing.T) { |
| 236 | root := setupFlowRoot(t) |
nothing calls this directly
no test coverage detected