org.specs2.specification.core

Members list

Type members

Classlikes

trait AsExecution[T]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AsExecution.type
case class Backtab(n: Int) extends Description

The next fragment must be un-indented

The next fragment must be un-indented

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Description
class Object
trait Matchable
class Any
Show all
case object Br extends Description

Break (== new line)

Break (== new line)

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Description
class Object
trait Matchable
class Any
Show all
Self type
Br.type
case class Code(text: String) extends Description

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Description
class Object
trait Matchable
class Any
Show all
trait Description

Description of a Fragment

Description of a Fragment

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Backtab
object Br.type
class Code
object End.type
class Marker
object NoText.type
object Start.type
class Tab
class Text
Show all
object Description

Creation methods for Descriptions

Creation methods for Descriptions

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case object End extends Description

End of a block

End of a block

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Description
class Object
trait Matchable
class Any
Show all
Self type
End.type
case class Env(arguments: Arguments, resources: Resources, systemLogger: Logger, printerLogger: PrinterLogger, statisticsRepository: StatisticsRepository, random: Random, fileSystem: FileSystem, customClassLoader: Option[ClassLoader], classLoading: ClassLoading, executionEnv: ExecutionEnv, specs2ExecutionEnv: ExecutionEnv)

Whole creation / execution / reporting environment for a specification

Whole creation / execution / reporting environment for a specification

Part of it is driven by the command-line, part of it is specs2 implementation Yet it can be used to drive the creation or execution of examples

Note: creating an Env instance is a delicate activity because the Env hold a thread pool that needs to be shutdown at the end of the execution

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Env.type
object EnvDefault

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
EnvDefault.type
case class ExecutedResult(result: Result, timer: SimpleTimer)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait Executing

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Failed
object NotExecuting.type
class Started
case class Execution(run: Option[Env => Future[() => Result]], executing: Executing, timeout: Option[FiniteDuration], mustJoin: Boolean, nextMustStopIf: Result => Boolean, previousResult: Option[Result], finalResultMap: Option[Result => Result], continuation: Option[FragmentsContinuation])

Execution of a Fragment

Execution of a Fragment

  • there can be none (for a piece of text)
  • the execution depends on the current Env. by default executions are created synchronously but can also be fork-off with Execution.withEnvAsync
  • it can have its own timeout (default is infinite)
  • once executed the result is kept
  • if mustJoin is true this means that all previous executions must be finished before this one can start
  • it has a condition deciding if the next execution can proceed or not depending on the current result
  • the result of a similar execution can be stored to decide if this one needs to be executed or not
  • it can store a continuation that will create more fragments, possibly containing more executions, based on the current result

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Execution.type
case class Failed(failure: Throwable) extends Executing

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Executing
class Object
trait Matchable
class Any
Show all
case class FatalExecution(t: Throwable) extends Exception

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Fragment(description: Description, execution: Execution, location: Location)

Fragment of a specification

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
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Fragment

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Fragment.type
case class Fragments(contents: AsyncStream[Fragment])

Fragments of a specification

Fragments of a specification

It is implemented as an async Producer[Fragment] in order to produce fragments dynamically if necessary

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Fragments.type
case class FragmentsContinuation(continue: Result => Option[Fragments])

Function creating more fragments (to be added to the specification) based on the current result

Function creating more fragments (to be added to the specification) based on the current result

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Structure of an immutable specification.

Structure of an immutable specification.

It may depend on the current environment.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait SpecLike
class Spec
trait SpecLike
class Spec
Show all
trait Location

Location of a Fragment

Location of a Fragment

This is currently implemented using stacktraces which is very brittle

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class Marker(tag: NamedTag, isSection: Boolean, appliesToNext: Boolean) extends Description

Description of a Tag fragment

Description of a Tag fragment

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Description
class Object
trait Matchable
class Any
Show all
case object NoText extends Description

NoText description, used when creating steps and actions which are not described

NoText description, used when creating steps and actions which are not described

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Description
class Object
trait Matchable
class Any
Show all
Self type
NoText.type
case object NotExecuting extends Executing

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Executing
class Object
trait Matchable
class Any
Show all
Self type
trait OwnEnv extends AfterSpec

This trait copies the inherited env: Env for a Specification and makes sure it is shutdown when the specification finishes

This trait copies the inherited env: Env for a Specification and makes sure it is shutdown when the specification finishes

The specification using this trait must require an Env:

class MySpec(env: Env) extends Specification with OwnEnv

Attributes

Supertypes
trait AfterSpec
class Object
trait Matchable
class Any
Show all
Self type
trait OwnExecutionEnv extends AfterSpec

This trait provides an isolated Execution Env for a Specification and makes sure it is shutdown when the specification finishes.

This trait provides an isolated Execution Env for a Specification and makes sure it is shutdown when the specification finishes.

The specification using this trait must require an Env:

class MySpec(env: Env) extends Specification with OwnExecutionEnv

Attributes

Supertypes
trait AfterSpec
class Object
trait Matchable
class Any
Show all
Self type
case class PositionLocation(path: String, lineNumber: Int, columnNumber: Int) extends Location

Location created from a Tasty position

Location created from a Tasty position

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ResourceExecution[T](resourceType: ResourceType, resource: Future[T], release: T => Execution)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class SpecHeader(specClass: Class[_], title: Option[String])

Header of a Specification

Header of a Specification

It can hold a user-defined title for better presentation

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
SpecHeader.type
case class SpecStructure(header: SpecHeader, arguments: Arguments, lazyFragments: () => Fragments)

Structure of a Specification:

Structure of a Specification:

  • a header
  • some arguments
  • specification fragments

Note that the fragments have to be lazy in order to avoid cycles when 2 specifications are referencing each other with links

Attributes

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

Create SpecStructures from header, arguments, fragments

Create SpecStructures from header, arguments, fragments

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class SpecificationRef(header: SpecHeader, arguments: Arguments, alias: String, tooltip: String, hidden: Boolean, muted: Boolean) extends Description

Reference to another specification

Reference to another specification

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case class StacktraceLocation(trace: Seq[StackTraceElement]) extends Location

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Location
class Object
trait Matchable
class Any
Show all
case object Start extends Description

Start of a block. This is used to delimit the blocks in mutable specifications and know exactly how to create levels when transforming a specification to a tree of examples (for JUnit for example)

Start of a block. This is used to delimit the blocks in mutable specifications and know exactly how to create levels when transforming a specification to a tree of examples (for JUnit for example)

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Description
class Object
trait Matchable
class Any
Show all
Self type
Start.type
case class Started(future: Future[(Result, SimpleTimer)]) extends Executing

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Executing
class Object
trait Matchable
class Any
Show all
case class Tab(n: Int) extends Description

The next fragment must be indented

The next fragment must be indented

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Description
class Object
trait Matchable
class Any
Show all
case class Text(text: String) extends Description

Text description

Text description

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Description
class Object
trait Matchable
class Any
Show all

Types

type Resources = Map[String, ResourceExecution[_]]