Documentation ¶
Overview ¶
Package exit provides stubs so that unit tests can exercise code that calls os.Exit(1).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type StubbedExit ¶
A StubbedExit is a testing fake for os.Exit.
func WithStub ¶
func WithStub(f func()) *StubbedExit
WithStub runs the supplied function with Exit stubbed. It returns the stub used, so that users can test whether the process would have crashed.
func (*StubbedExit) Unstub ¶
func (se *StubbedExit) Unstub()
Unstub restores the previous exit function.
Click to show internal directories.
Click to hide internal directories.