Files
beads/cmd/bd/setup/setup_test_helpers.go
Jordan Hubbard 8f8a075943 test: refactor factory setup for coverage (#790)
* test: add git helper and guard annotations

* chore: align release metadata with 0.40.0

* test: refactor factory setup for coverage
2025-12-29 14:15:56 -08:00

23 lines
317 B
Go

package setup
import "testing"
type exitCapture struct {
called bool
code int
}
func stubSetupExit(t *testing.T) *exitCapture {
t.Helper()
cap := &exitCapture{}
orig := setupExit
setupExit = func(code int) {
cap.called = true
cap.code = code
}
t.Cleanup(func() {
setupExit = orig
})
return cap
}