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

Function captureTemplatesListOutput

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

Source from the content-addressed store, hash-verified

17}
18
19func captureTemplatesListOutput(t *testing.T) (string, error) {
20 t.Helper()
21
22 oldStdout := os.Stdout
23 r, w, _ := os.Pipe()
24 os.Stdout = w
25
26 err := runTemplatesList(templatesListCmd, []string{})
27
28 w.Close()
29 os.Stdout = oldStdout
30
31 var buf bytes.Buffer
32 buf.ReadFrom(r)
33 return buf.String(), err
34}
35
36func TestTemplatesList_BuiltinTemplates(t *testing.T) {
37 tmpDir := t.TempDir()

Calls 1

runTemplatesListFunction · 0.85

Tested by

no test coverage detected