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.
Trait to which custom information about a running suite of tests can be reported.
An
Informer
is essentially used to wrap aReporter
and provide easy ways to send custom information to thatReporter
via anInfoProvided
event.Informer
contains anapply
method that takes a string and an optional payload object of typeAny
. TheInformer
will forward the passedmessage
string to theReporter
as themessage
parameter, and the optional payload object as thepayload
parameter, of anInfoProvided
event.Here's an example in which the
Informer
is used both directly viainfo
method of traitFlatSpec
and indirectly via the methods of traitGivenWhenThen
:If you run this
FlatSpec
from 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!