Result

org.specs2.execute.Result
See theResult companion object
sealed abstract class Result(val message: String, val expected: String)

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).

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class DecoratedResult[T]
class Error
class Failure
class Pending
class Skipped
class Success
Show all

Members list

Type members

Types

type SelfType <: Result

Value members

Abstract methods

def mute: Result

Attributes

Returns

the result with no message

set the number of expectations

set the number of expectations

Attributes

Concrete methods

increment the number of expectations

increment the number of expectations

Attributes

def coloredStatus(using args: Arguments): String

Attributes

Returns

the colored textual status of the result

def expectationsNb: Int

number of expectations for a Result The default number is 1 but this could be higher if this result represents the execution of a ScalaCheck property

number of expectations for a Result The default number is 1 but this could be higher if this result represents the execution of a ScalaCheck property

Attributes

def isError: Boolean

Attributes

Returns

true if the result is an Error instance

def isFailure: Boolean

Attributes

Returns

true if the result is a Failure instance

def isIssue: Boolean

Attributes

Returns

true if the result is a failure or an Error

def isPending: Boolean

Attributes

Returns

true if the result is a Pending instance

def isSkipped: Boolean

Attributes

Returns

true if the result is a Skipped instance

def isSuccess: Boolean

Attributes

Returns

true if the result is a Success instance

def isSuspended: Boolean

Attributes

Returns

true if the result is a Skipped or Pending

def isThrownFailure: Boolean

Attributes

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

Attributes

def negate: Result

Attributes

Returns

the negation of this result where a success becomes a failure and vice-versa

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

Attributes

def setMessage(msg: String): Result

set the message of a result, keeping the subclass type

set the message of a result, keeping the subclass type

Attributes

def status: String

Attributes

Returns

the uncolored textual status of the result

def statusName(using args: Arguments): String

Attributes

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

Attributes

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

change this result's message

change this result's message

Attributes

Concrete fields

val expected: String
val message: String