public class SystemExitListener
Will replace the SecurityManager used by the Java runtime
with a class NoExitSecurityManager that will throw an exception
if System.exit() is invoked. This exception can then be
tested for with shouldThrow().
To use this, override listeners() in your AbstractProjectConfig.
Note: This listener will change the security manager
for all tests. If you want to change the security manager
for just a single Spec then consider the
alternative class SpecSystemExitListener
| Modifier and Type | Field and Description |
|---|---|
static SystemExitListener |
INSTANCE
Will replace the SecurityManager used by the Java runtime
with a
class NoExitSecurityManager that will throw an exception
if System.exit() is invoked. This exception can then be
tested for with shouldThrow(). |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeProject() |
public static SystemExitListener INSTANCE
Will replace the SecurityManager used by the Java runtime
with a class NoExitSecurityManager that will throw an exception
if System.exit() is invoked. This exception can then be
tested for with shouldThrow().
To use this, override listeners() in your AbstractProjectConfig.
Note: This listener will change the security manager
for all tests. If you want to change the security manager
for just a single Spec then consider the
alternative class SpecSystemExitListener