Companion object that facilitates the importing of Payloads
members as
an alternative to mixing it in. One use case is to import Payloads
members so you can use them in the Scala interpreter.
- Companion:
- class
Value members
Inherited methods
Executes the block of code passed as the second parameter, and, if it
completes abruptly with a ModifiablePayload
exception,
replaces the current payload contained in the exception, if any, with the one passed
as the first parameter.
Executes the block of code passed as the second parameter, and, if it
completes abruptly with a ModifiablePayload
exception,
replaces the current payload contained in the exception, if any, with the one passed
as the first parameter.
This method allows you to insert a payload into a thrown Payload
exception (such as
a TestFailedException
), so that payload can be included in events fired to a custom reporter
that can make use of the payload.
Here's an example in which a GUI snapshot is included as a payload when a test fails:
withPayload(generateGUISnapshot()) { 1 + 1 should === (3) }
- Inherited from:
- Payloads