Abstract Value Members
-
def
apply
(message: String): Unit
Concrete Value Members
-
def
!=
(arg0: AnyRef): Boolean
-
def
!=
(arg0: Any): Boolean
-
def
##
(): Int
-
def
==
(arg0: AnyRef): Boolean
-
def
==
(arg0: Any): Boolean
-
def
andThen
[A]
(g: (Unit) ⇒ A): (String) ⇒ A
-
def
asInstanceOf
[T0]
: T0
-
def
clone
(): AnyRef
-
def
compose
[A]
(g: (A) ⇒ String): (A) ⇒ Unit
-
def
eq
(arg0: AnyRef): Boolean
-
def
equals
(arg0: Any): Boolean
-
def
finalize
(): Unit
-
def
getClass
(): java.lang.Class[_]
-
def
hashCode
(): Int
-
def
isInstanceOf
[T0]
: Boolean
-
def
ne
(arg0: AnyRef): Boolean
-
def
notify
(): Unit
-
def
notifyAll
(): Unit
-
def
synchronized
[T0]
(arg0: ⇒ T0): T0
-
def
toString
(): String
-
def
wait
(): Unit
-
def
wait
(arg0: Long, arg1: Int): Unit
-
def
wait
(arg0: Long): Unit
Inherited from (String) ⇒ Unit
Inherited from AnyRef
Inherited from Any
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 an object. TheInformer
will invoketoString
on the passed object and forward the resulting string to theReporter
as themessage
parameter of anInfoProvided
event.Here's an example of using an
Informer
in aSuite
subclass:If you run this
Suite
from the interpreter, you will see the message included in the printed report:scala> (new MySuite).execute() Test Starting - MySuite.testAddition(Reporter) Info Provided - MySuite.testAddition(Reporter): Addition seems to work Test Succeeded - MySuite.testAddition(Reporter)
Traits
FunSuite
,FunSpec
,FlatSpec
,WordSpec
,FeatureSpec
, and their sister traits inorg.scalatest.fixture
package declare an implicitinfo
method that returns anInformer
. This implicitinfo
is used, for example, to enable the syntax offered by theGivenWhenThen
trait, which contains methods that take an implicitInformer
. Here's an example of aFeatureSpec
that mixes inGivenWhenThen
:Were you to run this
FeatureSpec
in the interpreter, you would see the following messages included in the printed report:scala> (new ArithmeticFeatureSpec).run() Feature: Integer arithmetic Scenario: addition Given two integers When they are added Then the result is the sum of the two numbers Scenario: subtraction Given two integers When one is subtracted from the other Then the result is the difference of the two numbers