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

Function captureRmOutput

apps/cli/internal/cli/rm_test.go:63–78  ·  view source on GitHub ↗
(t *testing.T, args []string)

Source from the content-addressed store, hash-verified

61}
62
63func captureRmOutput(t *testing.T, args []string) (string, error) {
64 t.Helper()
65
66 oldStdout := os.Stdout
67 r, w, _ := os.Pipe()
68 os.Stdout = w
69
70 err := runRm(rmCmd, args)
71
72 w.Close()
73 os.Stdout = oldStdout
74
75 var buf bytes.Buffer
76 buf.ReadFrom(r)
77 return buf.String(), err
78}
79
80func TestRm_WithForce(t *testing.T) {
81 tmpDir := createRmTestFiles(t)

Callers 12

TestRm_WithForceFunction · 0.85
TestRm_DryRunFunction · 0.85
TestRm_TaskNotFoundFunction · 0.85
TestRm_BlockedByParentFunction · 0.85
TestRm_DeletesWorklogFunction · 0.85
TestRm_ShowsTaskDetailsFunction · 0.85

Calls 1

runRmFunction · 0.85

Tested by

no test coverage detected