class Checkpoint extends AnyRef
Class that allows multiple assertions to be performed within a test, with any failures accumulated and reported together at the end of the test.
See the main documentation for trait Checkpoints
for more information and an example.
- Source
- Checkpoints.scala
- Alphabetic
- By Inheritance
- Checkpoint
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Checkpoint()
Value Members
-
def
apply(f: ⇒ Unit): Unit
Executes the passed block of code and catches and records for later reporting (via
reportAll
) any exceptions that mix inStackDepth
except forTestCanceledException
,TestRegistrationClosedException
,NotAllowedException
, andDuplicateTestNameException
.Executes the passed block of code and catches and records for later reporting (via
reportAll
) any exceptions that mix inStackDepth
except forTestCanceledException
,TestRegistrationClosedException
,NotAllowedException
, andDuplicateTestNameException
.If the block of code completes abruptly with any of the
StackDepth
exceptions in the previous list, or any non-StackDepth
exception, that invocation of thisapply
method will complete abruptly with the same exception.- f
the block of code, likely containing one or more assertions, to execute
-
def
reportAll()(implicit pos: Position): Unit
If any failures were caught by checkpoints, throws a
TestFailedException
whose detail message lists the failure messages and line numbers from each of the failed checkpoints.If any failures were caught by checkpoints, throws a
TestFailedException
whose detail message lists the failure messages and line numbers from each of the failed checkpoints.