ShouldExpectable

org.specs2.matcher.ShouldExpectable
See theShouldExpectable companion object
class ShouldExpectable[T] extends Expectable[T]

This kind of expectable can be followed by the verb should to apply a matcher:

1 should beEqualTo(1)

For convenience, several shouldMatcher methods have also been defined as shortcuts to equivalent:

a should matcher

Attributes

Companion
object
Graph
Supertypes
class Expectable[T]
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def should(m: => Matcher[T]): Result
def shouldEqual(other: => Any): Result
def shouldNotEqual(other: => Any): Result
def should_!=(other: => Any): Result
def should_!==(other: => T)(using di: Diffable[T]): Result
def should_==(other: => Any): Result
def should_===(other: => T)(using di: Diffable[T]): Result

Inherited methods

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

apply a matcher on the value and return a Result

apply a matcher on the value and return a Result

Attributes

Inherited from:
Expectable
def describe(v: Any): String

Attributes

Returns

a description of any value with the custom description

Inherited from:
Expectable
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

Inherited from:
Expectable

evaluate the value and return the same expectable

evaluate the value and return the same expectable

Attributes

Inherited from:
Expectable

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

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

change the expectable value

change the expectable value

Attributes

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

apply a function to the expectable value

apply a function to the expectable value

Attributes

Inherited from:
Expectable
def mapDescription(d: String): Expectable[T]

Attributes

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

Attributes

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

apply a function to the description function

apply a function to the description function

Attributes

Inherited from:
Expectable
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

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

update the description with another description

update the description with another description

Attributes

Inherited from:
Expectable

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

Inherited from:
Expectable

Inherited fields

lazy val value: T

the value is only evaluated if necessary

the value is only evaluated if necessary

Attributes

Inherited from:
Expectable