Provide information and optionally, a payload, to the Reporter via an
InfoProvided event.
Provide information and optionally, a payload, to the Reporter via an
InfoProvided event.
a string that will be forwarded to the wrapped Reporter
via an InfoProvided event.
an optional object which will be forwarded to the wrapped Reporter
as a payload via an InfoProvided event.
if message or payload reference is null
Trait to which custom information about a running suite of tests can be reported.
An
Informeris essentially used to wrap aReporterand provide easy ways to send custom information to thatReportervia anInfoProvidedevent.Informercontains anapplymethod that takes a string and an optional payload object of typeAny. TheInformerwill forward the passedmessagestring to theReporteras themessageparameter, and the optional payload object as thepayloadparameter, of anInfoProvidedevent.Here's an example in which the
Informeris used both directly viainfomethod of traitFlatSpecand indirectly via the methods of traitGivenWhenThen:If you run this
SetSpecfrom the interpreter, you will see the following output:scala> new SetSpec execute A mutable Set - should allow an element to be added + Given an empty mutable Set + When an element is added + Then the Set should have size 1 + And the Set should contain the added element + That's all folks!