Package exit provides stubs so that unit tests can exercise code that calls os.Exit(1).
Exit normally terminates the process by calling os.Exit(1). If the package is stubbed, it instead records a call in the testing spy.
A StubbedExit is a testing fake for os.Exit.
Stub substitutes a fake for the call to os.Exit(1).
WithStub runs the supplied function with Exit stubbed. It returns the stub used, so that users can test whether the process would have crashed.
Unstub restores the previous exit function.