Fragment

org.specs2.specification.core.Fragment
See theFragment companion object
case class Fragment(description: Description, execution: Execution, location: Location)

Fragment of a specification

It has a description (generally text but sometimes not, for a step for example) It has an execution which might do or don't do anything (for examples it runs some code)

By default its location is provided by a stacktrace containing the user file with line number which triggered this fragment creation. The location is however provided by a macro in the case of s2 interpolated strings

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Attributes

Returns

the result of this fragment and its execution time

def executionResult: Action[Result]

Attributes

Returns

the result of this fragment

def isExecutable: Boolean

Attributes

Returns

true if this fragment can be executed

def join: Fragment

various methods to stop the execution of the next fragment

various methods to stop the execution of the next fragment

Attributes

def mustStopOn(r: Result): Boolean

Attributes

Returns

stop the execution of the next fragment based on a condition

set a different execution

set a different execution

Attributes

def setLocation(location: Location): Fragment
def setPreviousResult(r: Option[Result]): Fragment

set the previous execution result when known

set the previous execution result when known

Attributes

def setTimeout(timeout: FiniteDuration): Fragment
def skip: Fragment

skip this fragment

skip this fragment

Attributes

start the execution of this fragment

start the execution of this fragment

Attributes

start the execution of this fragment when the other one has finished executing

start the execution of this fragment when the other one has finished executing

Attributes

def startExecutionAfter(other: Option[Fragment])(env: Env): Fragment

start the execution of this fragment when the other one has finished executing

start the execution of this fragment when the other one has finished executing

Attributes

def startExecutionAfter(others: List[Fragment])(env: Env): Fragment

start the execution of this fragment when the other ones has finished executing

start the execution of this fragment when the other ones has finished executing

Attributes

def stopOn(r: Result): Fragment

various methods to stop the execution of the next fragment

various methods to stop the execution of the next fragment

Attributes

def stopWhen(f: Result => Boolean): Fragment
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

update the description

update the description

Attributes

def updateResult(f: (=> Result) => Result): Fragment
def was(statusCheck: String => Boolean): Boolean

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product