AllExpectations

org.specs2.specification.AllExpectations
trait AllExpectations extends StoredExpectations, FragmentsFactory, SpecificationStructure, 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 can either run sequentially or isolated.

If the specification is neither sequential or isolated, we force it to be isolated by default.

Attributes

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

Members list

Type members

Inherited classlikes

class Descriptible[T](value: => T)

Attributes

Inherited from:
ExpectationsDescription
Supertypes
class Object
trait Matchable
class Any
class ExpectationDescription(description: String)

Attributes

Inherited from:
ExpectationsDescription
Supertypes
class Object
trait Matchable
class Any
class TypedEqualExpectation[T](t: => T)

Attributes

Inherited from:
TypedEqual
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

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
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
StandardResults
override def map(structure: SpecStructure): SpecStructure

modify the specification structure

modify the specification structure

Attributes

Definition Classes
def resultsContext(results: => Seq[Result]): Context

create a new Context with the list of captured results.

create a new Context with the list of captured results.

This method could be overridden to filter the captured results and remove the skipped results for example

Attributes

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
StandardResults

Inherited methods

def addLocation(message: String, location: String): String

Attributes

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], batchSize: ArgProperty[Int], asap: ArgProperty[Boolean], isolated: 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
protected def checkFailure[T](m: MatchResult[T]): MatchResult[T]

this method can be overridden to throw exceptions when checking the match result

this method can be overridden to throw exceptions when checking the match result

Attributes

Inherited from:
ExpectationsCreation
override protected def checkMatchResultFailure[T](m: MatchResult[T]): MatchResult[T]

this method can be overridden to throw exceptions when checking the match result

this method can be overridden to throw exceptions when checking the match result

Attributes

Definition Classes
StoredExpectations -> ExpectationsCreation
Inherited from:
StoredExpectations
override protected def checkResultFailure(r: => Result): Result

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

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

Attributes

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

Attributes

Returns

an Expectable with a description function

Inherited from:
ExpectationsCreation
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 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
def failure: Failure

Attributes

Inherited from:
StandardResults

Attributes

Inherited from:
ContextualSpecificationStructure

Attributes

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

modify the fragments, using the current environment

modify the fragments, using the current environment

Attributes

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

modify the fragments

modify the fragments

Attributes

Inherited from:
SpecificationStructure
protected def mapMatchResult[T](m: MatchResult[T]): MatchResult[T]

this method can be overridden to intercept a MatchResult and change its message before it is thrown

this method can be overridden to intercept a MatchResult and change its message before it is thrown

Attributes

Inherited from:
ExpectationsCreation
def pending[R : AsResult](r: => R): Pending

Attributes

Inherited from:
StandardResults
def pending: Pending

Attributes

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

Attributes

Inherited from:
StandardResults
override def sandboxMatchResult[T](mr: => MatchResult[T]): MatchResult[T]

Attributes

Returns

the match result without any side-effects

Definition Classes
StoredExpectations -> ExpectationsCreation
Inherited from:
StoredExpectations
protected def setStacktrace[T](m: MatchResult[T]): MatchResult[T]

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 : AsResult](r: => R): Skipped

Attributes

Inherited from:
StandardResults
def skipped: Skipped

Attributes

Inherited from:
StandardResults
def storedResults: Seq[Result]

Attributes

Inherited from:
StoredExpectations

Attributes

Inherited from:
SpecificationStructure
def success: Success

Attributes

Inherited from:
StandardResults
def todo: Pending

Attributes

Inherited from:
StandardResults
def wontdo: Success

Attributes

Inherited from:
StandardResults

Inherited fields

lazy val args: ArgumentsNamespace

Attributes

Inherited from:
ArgumentsCreation

Implicits

Implicits

implicit override protected def fragmentFactory: FragmentFactory

Attributes

Returns

an example factory which will take the stored results and make them the example result

Definition Classes

Inherited implicits

implicit def describe[T](t: => T): Descriptible[T]

describe a value with the aka method

describe a value with the aka method

Attributes

Inherited from:
ExpectationsDescription
implicit def describeExpectation(description: String): ExpectationDescription

Attributes

Inherited from:
ExpectationsDescription
implicit def typedEqualExpectation[T](t: => T): TypedEqualExpectation[T]

A value can be tested against another with the === operator. It is equivalent to writing a must_== b

A value can be tested against another with the === operator. It is equivalent to writing a must_== b

Attributes

Inherited from:
TypedEqual