AllExpectations

org.specs2.specification.AllExpectations
trait AllExpectations extends SpecificationStructure, StoredExpectations, ArgumentsCreation, StandardResults

This trait can be mixed-in a specification to allow examples to have all of their expectations being evaluated (unless the example body throws an exception of course).

All the results are collected into a list, provided by the StoredExpectations trait. These results form then the body of the each example (decorated by a special ExampleFactory) so that each example returns a Result which is the summary of all the individual issues.

It must be noted that this trait relies on a mutable list to collect the results as they are created in the example body. Because of this restriction, a Specification using that trait must run sequentially

If the specification is not sequential we force it to be

Attributes

Graph
Supertypes
trait ArgumentsCreation
trait StandardResults
trait Expectations
trait ExpectationsDescription
trait TypedEqual
trait ExpectationsCreation
trait ResultChecks
trait MatchResultStackTrace
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def flatMap(f: Fragment): Fragments

modify the fragments

modify the fragments

Attributes

Definition Classes
override def map(structure: SpecStructure): SpecStructure

modify the specification structure

modify the specification structure

Attributes

Definition Classes

Inherited methods

def anError(message: String): Error

Attributes

Inherited from:
StandardResults
override def anError: Error

use a side-effect to register a standard result

use a side-effect to register a standard result

Attributes

Definition Classes
StoredExpectations -> StandardResults
Inherited from:
StoredExpectations
def args(ex: ArgProperty[String], include: ArgProperty[String], exclude: ArgProperty[String], was: ArgProperty[String], plan: ArgProperty[Boolean], skipAll: ArgProperty[Boolean], stopOnFail: ArgProperty[Boolean], stopOnError: ArgProperty[Boolean], stopOnIssue: ArgProperty[Boolean], stopOnSkip: ArgProperty[Boolean], sequential: ArgProperty[Boolean], sequentialRandom: ArgProperty[Boolean], batchSize: ArgProperty[Int], timeFactor: ArgProperty[Int], timeout: ArgProperty[FiniteDuration], asap: ArgProperty[Boolean], xonly: ArgProperty[Boolean], showOnly: ArgProperty[String], color: ArgProperty[Boolean]): Arguments

shorthand method to create an Arguments object

shorthand method to create an Arguments object

Attributes

Inherited from:
ArgumentsCreation
override protected def checkResultFailure(r: => Result): Result

this method can be overridden to throw exceptions when checking a result

this method can be overridden to throw exceptions when checking a result

Attributes

Definition Classes
StoredExpectations -> ResultChecks
Inherited from:
StoredExpectations
def createExpectable[T](t: => T, alias: String => String): Expectable[T]

Attributes

Returns

an Expectable with a description function

Inherited from:
ExpectationsCreation
def createExpectable[T](t: => T, alias: => String): Expectable[T]

Attributes

Returns

an Expectable with a description

Inherited from:
ExpectationsCreation
def createExpectable[T](t: => T): Expectable[T]

Attributes

Returns

an Expectable

Inherited from:
ExpectationsCreation
def createExpectable[T](t: => T, alias: Option[String => String]): Expectable[T]

Attributes

Returns

an Expectable with a description function

Inherited from:
ExpectationsCreation
def createExpectableWithShowAs[T](t: => T, showAs: => String): Expectable[T]

Attributes

Returns

an Expectable with a function to show the element T

Inherited from:
ExpectationsCreation

Attributes

Inherited from:
SpecificationStructure
def done: Success

Attributes

Inherited from:
StandardResults
override def failure(message: String): Failure

use a side-effect to register a standard result

use a side-effect to register a standard result

Attributes

Definition Classes
StoredExpectations -> StandardResults
Inherited from:
StoredExpectations
def failure: Failure

Attributes

Inherited from:
StandardResults

Attributes

Inherited from:
SpecificationStructure
def map(fs: => Fragments): Fragments

modify the fragments

modify the fragments

Attributes

Inherited from:
SpecificationStructure
protected def mapResult(r: Result): Result

this method can be overridden to intercept a Result and modify it. It is used for example to set a stacktrace providing the location of a failure

this method can be overridden to intercept a Result and modify it. It is used for example to set a stacktrace providing the location of a failure

Attributes

Inherited from:
ResultChecks
def pending[R](r: => R)(using evidence$1: AsResult[R]): Pending

Attributes

Inherited from:
StandardResults
def pending(message: String): Pending

Attributes

Inherited from:
StandardResults
def pending: Pending

Attributes

Inherited from:
StandardResults
override def sandboxResult(r: => Result): Result

Attributes

Returns

the result without any side-effects

Definition Classes
StoredExpectations -> ResultChecks
Inherited from:
StoredExpectations
protected def setStacktrace(m: Result): Result

this method can be overridden to avoid filling-in a stacktrace indicating the location of the result

this method can be overridden to avoid filling-in a stacktrace indicating the location of the result

Attributes

Inherited from:
MatchResultStackTrace
def skipped[R](r: => R)(using evidence$2: AsResult[R]): Skipped

Attributes

Inherited from:
StandardResults
override def skipped(message: String): Skipped

use a side-effect to register a standard result

use a side-effect to register a standard result

Attributes

Definition Classes
StoredExpectations -> StandardResults
Inherited from:
StoredExpectations
def skipped: Skipped

Attributes

Inherited from:
StandardResults
def storedResults: Seq[Result]

Attributes

Inherited from:
StoredExpectations

Attributes

Inherited from:
SpecificationStructure
def success(message: String): Success

Attributes

Inherited from:
StandardResults
def success: Success

Attributes

Inherited from:
StandardResults
def theBlock(t: => Nothing): Expectable[Nothing]

Attributes

Inherited from:
ExpectationsCreation
def theValue[T](t: => T): Expectable[T]

Attributes

Inherited from:
ExpectationsCreation
def todo: Pending

Attributes

Inherited from:
StandardResults
def wontdo: Success

Attributes

Inherited from:
StandardResults

Inherited fields

lazy val args: ArgumentsNamespace

Attributes

Inherited from:
ArgumentsCreation

Extensions

Inherited extensions

extension [T](description: String)(using not: NotGiven[NoExpectationsDescription])(using evidence$2: AsResult[T])
def <==>(result: => T): Result

Attributes

Inherited from:
ExpectationsDescription
extension [T](description: String)(using not: NotGiven[NoExpectationsDescription])(using evidence$1: AsResult[T])
def ==>(result: => T): Result

Attributes

Inherited from:
ExpectationsDescription
extension [T](t: => T)(using not: NotGiven[NoTypedEqual])(using evidence$2: Diffable[T])
def !==(other: => T): Result

! equality matcher on Expectables

! equality matcher on Expectables

Attributes

Inherited from:
TypedEqual
extension [T](t: => T)(using not: NotGiven[NoTypedEqual])(using evidence$1: Diffable[T])
def ===(other: => T): Result

equality matcher on Expectables

equality matcher on Expectables

Attributes

Inherited from:
TypedEqual
extension [T](value: => T)(using not: NotGiven[NoValueDescription])
infix def aka(alias: => String): Expectable[T]

Attributes

Returns

an expectable with an alias description

Inherited from:
ExpectationsDescription
infix def aka: Expectable[T]

Attributes

Returns

an expectable with its toString method as an alias description this is useful to preserve the original value when the matcher using it is adapting the value

Inherited from:
ExpectationsDescription
infix def as(alias: String => String): Expectable[T]

Attributes

Returns

an expectable with an alias description, after the value string

Inherited from:
ExpectationsDescription
infix def post(alias: => String): Expectable[T]

Attributes

Returns

an expectable with an alias description, after the value string

Inherited from:
ExpectationsDescription
infix def showAs(show: T => String): Expectable[T]

Attributes

Returns

an expectable with a function to show the element T

Inherited from:
ExpectationsDescription
extension [T](value: => T)(using not: NotGiven[NoValueDescription], show: T => String)
infix def showAs: Expectable[T]

Attributes

Returns

an expectable with a function to show the element T

Inherited from:
ExpectationsDescription