Result

sealed abstract class Result(val message: String, val expected: String, val expectationsNb: Int)

The result of an execution, either:

  • a success: the execution is ok
  • a failure: an expectation is not met
  • an error: an exception occurred
  • a pending execution: the user has decided that execution must not be performed
  • a skipped execution: based on dynamic conditions (a database not available for instance) the execution is not performed

A Result has:

  • a message describing the outcome
  • a message describing the expectation
  • possibly a number of expectations when it is the outcome of several checks (this is used for the reporting of ScalaCheck properties).
Companion:
object
class Object
trait Matchable
class Any
class Error
class Failure
class Pending
class Skipped
class Success

Type members

Types

Value members

Abstract methods

Returns:

the result with no message

set the number of expectations

set the number of expectations

Concrete methods

increment the number of expectations

increment the number of expectations

def coloredStatus(implicit args: Arguments): String
Returns:

the colored textual status of the result

def isError: Boolean
Returns:

true if the result is an Error instance

def isFailure: Boolean
Returns:

true if the result is a Failure instance

def isIssue: Boolean
Returns:

true if the result is a failure or an Error

def isPending: Boolean
Returns:

true if the result is a Pending instance

def isSkipped: Boolean
Returns:

true if the result is a Skipped instance

def isSuccess: Boolean
Returns:

true if the result is a Success instance

def isSuspended: Boolean
Returns:

true if the result is a Skipped or Pending

def isThrownFailure: Boolean
Returns:

true if the result is a Failure that was thrown like a JUnit assertion error or a NotImplemented exception

def mapExpected(f: String => String): Result

change this result's expected

change this result's expected

def mapMessage(f: String => String): Result

change this result's message

change this result's message

def prependMessage(pre: String): Result

prepend another message and a conjunction depending on the status of this result

prepend another message and a conjunction depending on the status of this result

def status: String
Returns:

the uncolored textual status of the result

def statusName(implicit args: Arguments): String
Returns:

the textual status of the result

def updateExpected(exp: String): Result

update the expected of a result, keeping the subclass type

update the expected of a result, keeping the subclass type

def updateMessage(msg: String): Result

update the message of a result, keeping the subclass type

update the message of a result, keeping the subclass type

Concrete fields

val expected: String
val message: String