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 markup text tests can be reported.
A
Documenteris essentially used to wrap aReporterand provide easy ways to send markup text to thatReportervia aMarkupProvidedevent.Documentercontains anapplymethod that takes a string. TheDocumenterwill forward the passed string to theReporteras thetextparameter of anMarkupProvidedevent.Here's an example of using an
Documenterin aSuitesubclass:As of 2.0, the only built-in reporter that presents markup text is the HTML reporter. If you run this
Suiteand specify the HTML reporter, you will see the message included in the HTML report:scala> (new MySuite).execute() - testAddition(Informer) + Addition seems to workTraits
FunSuite,Spec,FlatSpec,WordSpec,FeatureSpec, and their sister traits inorg.scalatest.fixturepackage declare an implicitmarkupmethod that returns anDocumenter. Here's an example of aSpecthat usesmarkup:Were you to run this
FeatureSpecin 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