Creates a Canceled outcome given a string message.
Creates a Canceled outcome given a string message.
For example, trait CancelAfterFailure uses this factory method to create
a Canceled status if a cancelRemaining flag is set, which will
be the case if a test failed previously while running the suite:
abstract override def withFixture(test: NoArgTest): Outcome = {
if (cancelRemaining)
Canceled("Canceled by CancelOnFailure because a test failed previously")
else
super.withFixture(test) match {
case failed: Failed =>
cancelRemaining = true
failed
case outcome => outcome
}
}
Companion object to class
Canceledthat provides, in addition to the extractor and factory method provided by the compiler given its companion is a case class, a second factory method that produces aCanceledoutcome given a string message.