org.specs2.specification.core
Type members
Classlikes
Creation methods for Descriptions
Creation methods for Descriptions
- Companion
- class
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
- Companion
- object
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
- Companion
- object
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
- Companion
- object
Fragments of a specification
Fragments of a specification
It is implemented as an async Producer[Fragment] in order to produce fragments dynamically if necessary
- Companion
- object
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
- Companion
- object
Structure of an immutable specification.
Structure of an immutable specification.
It may depend on the current environment.
Location of a Fragment
Location of a Fragment
This is currently implemented using stacktraces which is very brittle
NoText description, used when creating steps and actions which are not described
NoText description, used when creating steps and actions which are not described
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
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
Header of a Specification
Header of a Specification
It can hold a user-defined title for better presentation
- Companion
- object
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
- Companion
- object
Create SpecStructures from header, arguments, fragments
Create SpecStructures from header, arguments, fragments
- Companion
- class
Reference to another specification
Reference to another specification
- Companion
- object
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)