(t *testing.T)
| 96 | } |
| 97 | |
| 98 | func 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 | |
| 122 | func TestTemplatesList_InvalidFormat(t *testing.T) { |
| 123 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected