Expectable

org.specs2.matcher.Expectable
See theExpectable companion object
class Expectable[+T]

The Expectable class models anything which can be checked by applying a Matcher

It stores a value which is only evaluated when necessary and an optional additional description for that value.

The Expectable object is responsible for creating its own description, based on the value toString method and and an additional description.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class MustExpectable[T]
class ShouldExpectable[T]
Self type

Members list

Value members

Concrete methods

def applyMatcher[S >: T](m: => Matcher[S]): MatchResult[S]

apply a matcher on the value and return a MatchResult which can later on be transformed to a simple Result

apply a matcher on the value and return a MatchResult which can later on be transformed to a simple Result

Attributes

def check[S >: T](result: MatchResult[S]): MatchResult[S]

additional checks can be done on the result, such as throwing an exception

additional checks can be done on the result, such as throwing an exception

Attributes

def checkResult(result: Result): Result

additional checks can be done on a result, such as throwing an exception

additional checks can be done on a result, such as throwing an exception

Attributes

def describe(v: Any): String

Attributes

Returns

a description of any value with the custom description

def description: String

Attributes

Returns

a description of the value provided by the user a combination of the value show by specs2 and an optional description

evaluate the value and return the same expectable

evaluate the value and return the same expectable

Attributes

evaluate the value once and return an expectable with the same expression, ready to be evaluated again

evaluate the value once and return an expectable with the same expression, ready to be evaluated again

Attributes

def flatMap[S](f: T => Expectable[S]): Expectable[S]

apply a function to the value

apply a function to the value

Attributes

def map[S](f: T => S): Expectable[S]

apply a function to the expectable value

apply a function to the expectable value

Attributes

def map[S](other: S): Expectable[S]

change the expectable value

change the expectable value

Attributes

def mapDescription(d: Option[String => String]): Expectable[T]

apply a function to the description function

apply a function to the description function

Attributes

def mapDescription(d: String => String): Expectable[T]
def mapDescription(d: String): Expectable[T]
def optionalDescription: Option[String => String]

Attributes

Returns

the optional description function

def updateDescription(d: String => String): Expectable[T]

update the description with another description

update the description with another description

Attributes

Concrete fields

lazy val value: T

the value is only evaluated if necessary

the value is only evaluated if necessary

Attributes

lazy val valueDefinition: () => T

definition of the value, possibly evaluating to different results each time it is invoked

definition of the value, possibly evaluating to different results each time it is invoked

Attributes