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

Function captureCommitMsgOutput

apps/cli/internal/cli/commit_msg_test.go:158–173  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

156}
157
158func captureCommitMsgOutput(t *testing.T) (string, error) {
159 t.Helper()
160
161 oldStdout := os.Stdout
162 r, w, _ := os.Pipe()
163 os.Stdout = w
164
165 err := runCommitMsg(commitMsgCmd, nil)
166
167 w.Close()
168 os.Stdout = oldStdout
169
170 var buf bytes.Buffer
171 buf.ReadFrom(r)
172 return buf.String(), err
173}
174
175func TestCommitMsg_SingleTask(t *testing.T) {
176 tmpDir := createCommitMsgTestFiles(t)

Calls 1

runCommitMsgFunction · 0.85

Tested by

no test coverage detected