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

Function TestTemplatesList_YAMLFormat

apps/cli/internal/cli/templates_cmd_test.go:98–120  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

96}
97
98func TestTemplatesList_YAMLFormat(t *testing.T) {
99 tmpDir := t.TempDir()
100 resetTemplatesFlags()
101 taskDir = tmpDir
102 templatesFormat = "yaml"
103
104 // Change to tmpDir so resolveProjectRoot() doesn't find the real project root
105 oldDir, _ := os.Getwd()
106 os.Chdir(tmpDir)
107 defer os.Chdir(oldDir)
108
109 output, err := captureTemplatesListOutput(t)
110 if err != nil {
111 t.Fatalf("unexpected error: %v", err)
112 }
113
114 if !strings.Contains(output, "name: feature") {
115 t.Error("expected YAML output with feature template")
116 }
117 if !strings.Contains(output, "source: built-in") {
118 t.Error("expected YAML output with built-in source")
119 }
120}
121
122func TestTemplatesList_InvalidFormat(t *testing.T) {
123 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 3

resetTemplatesFlagsFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected