MCPcopy Create free account
hub / github.com/github/gh-aw / captureUpdateOrgStderr

Function captureUpdateOrgStderr

pkg/cli/update_org_test.go:537–554  ·  view source on GitHub ↗
(t *testing.T, fn func())

Source from the content-addressed store, hash-verified

535}
536
537func captureUpdateOrgStderr(t *testing.T, fn func()) string {
538 t.Helper()
539 orig := os.Stderr
540 r, w, err := os.Pipe()
541 require.NoError(t, err)
542 os.Stderr = w
543 defer func() {
544 _ = r.Close()
545 os.Stderr = orig
546 }()
547
548 fn()
549
550 require.NoError(t, w.Close())
551 data, err := io.ReadAll(r)
552 require.NoError(t, err)
553 return string(data)
554}
555
556func TestGetLatestWorkflowEditTimeFromCheckout(t *testing.T) {
557 t.Parallel()

Calls 2

fnFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected