Stub substitutes a fake for the call to os.Exit(1).
()
| 41 | |
| 42 | // Stub substitutes a fake for the call to os.Exit(1). |
| 43 | func Stub() *StubbedExit { |
| 44 | s := &StubbedExit{prev: _exit} |
| 45 | _exit = s.exit |
| 46 | return s |
| 47 | } |
| 48 | |
| 49 | // WithStub runs the supplied function with Exit stubbed. It returns the stub |
| 50 | // used, so that users can test whether the process would have crashed. |
no outgoing calls