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

Function TestProjects_YAMLOutput

apps/cli/internal/cli/projects_test.go:230–254  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

228}
229
230func TestProjects_YAMLOutput(t *testing.T) {
231 resetProjectsFlags()
232 projectsFormat = "yaml"
233
234 projectDir := createProjectWithTasks(t, "tasks", map[string]string{
235 "001.md": taskFile("001", "Task A", "completed"),
236 })
237
238 setupGlobalRegistry(t, "projects:\n"+
239 " - id: proj1\n"+
240 " name: \"YAML Project\"\n"+
241 " path: "+projectDir+"\n")
242
243 stdout, _, err := captureProjectsOutput(t)
244 if err != nil {
245 t.Fatalf("unexpected error: %v", err)
246 }
247
248 if !strings.Contains(stdout, "name: YAML Project") {
249 t.Errorf("expected YAML output with project name, got:\n%s", stdout)
250 }
251 if !strings.Contains(stdout, "completed: 1") {
252 t.Errorf("expected YAML output with completed count, got:\n%s", stdout)
253 }
254}
255
256func TestProjects_DefaultTaskDir(t *testing.T) {
257 resetProjectsFlags()

Callers

nothing calls this directly

Calls 5

resetProjectsFlagsFunction · 0.85
createProjectWithTasksFunction · 0.85
taskFileFunction · 0.85
setupGlobalRegistryFunction · 0.85
captureProjectsOutputFunction · 0.85

Tested by

no test coverage detected