package core

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. trait AsExecution[T] extends AnyRef
  2. case class Backtab(n: Int = 1) extends Description with Product with Serializable

    The next fragment must be un-indented

  3. case class Code(text: String) extends Description with Product with Serializable
  4. trait ContextualSpecificationStructure extends AnyRef
    Annotations
    @EnableReflectiveInstantiation()
  5. trait Description extends AnyRef

    Description of a Fragment

  6. case class Env(arguments: Arguments, systemLogger: Logger, selectorInstance: (Arguments) => Selector, executorInstance: (Arguments) => Executor, lineLogger: LineLogger, statsRepository: (Arguments) => StatisticsRepository, random: Random, fileSystem: FileSystem, executionParameters: ExecutionParameters, customClassLoader: Option[ClassLoader], classLoading: ClassLoading, executionEnv: ExecutionEnv, specs2ExecutionEnv: ExecutionEnv) extends Product with Serializable

    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

  7. case class ExecutedResult(result: Result, timer: SimpleTimer) extends Product with Serializable
  8. trait Executing extends AnyRef
  9. case class Execution(run: Option[(Env) => Future[() => Result]] = None, executing: Executing = NotExecuting, timeout: Option[FiniteDuration] = None, mustJoin: Boolean = false, nextMustStopIf: (Result) => Boolean = (r: Result) => false, isolable: Boolean = true, previousResult: Option[Result] = None, continuation: Option[FragmentsContinuation] = None) extends Product with Serializable

    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
    • if isolable is true this means that it should be executed in its own specification instance
    • 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
  10. case class ExecutionParameters(timeout: Option[FiniteDuration] = None, withIsolation: Boolean = true) extends Product with Serializable
  11. case class Failed(failure: Throwable) extends Executing with Product with Serializable
  12. case class FatalExecution(t: Throwable) extends Exception with Product with Serializable
  13. case class Fragment(description: Description, execution: Execution, location: Location = StacktraceLocation()) extends Product with Serializable

    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)

  14. case class Fragments(contents: AsyncStream[Fragment]) extends Product with Serializable

    Fragments of a specification

    Fragments of a specification

    It is implemented as a Process of Fragment in order to produce fragments dynamically if necessary

  15. case class FragmentsContinuation(continue: (Result) => Option[Fragments]) extends Product with Serializable

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

  16. trait ImmutableSpecificationStructure extends SpecificationStructure

    Structure of an immutable specification.

    Structure of an immutable specification.

    It may depend on the current environment.

    If the examples need to be executed in their own instance of the specification they will be "isolated"

  17. trait Location extends AnyRef

    Location of a Fragment

    Location of a Fragment

    This is currently implemented using stacktraces which is very brittle

  18. case class Marker(tag: NamedTag, isSection: Boolean = false, appliesToNext: Boolean = true) extends Description with Product with Serializable

    Description of a Tag fragment

  19. trait OwnEnv extends AfterAll

    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

  20. trait OwnExecutionEnv extends AfterAll

    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

  21. case class SimpleLocation(trace: TraceLocation) extends Location with Product with Serializable
  22. case class SpecHeader(specClass: Class[_], title: Option[String] = None) extends Product with Serializable

    Header of a Specification

    Header of a Specification

    It can hold a user-defined title for better presentation

  23. case class SpecStructure(header: SpecHeader, arguments: Arguments, lazyFragments: () => Fragments) extends Product with Serializable

    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

  24. case class SpecificationRef(header: SpecHeader, arguments: Arguments, alias: String = "", tooltip: String = "", hidden: Boolean = false, muted: Boolean = false) extends Description with Product with Serializable

    Reference to another specification

  25. trait SpecificationStructure extends ContextualSpecificationStructure
  26. case class StacktraceLocation(trace: Seq[StackTraceElement] = new Exception).getStackTrace) extends Location with Product with Serializable
  27. case class Started(future: Future[(Result, SimpleTimer)]) extends Executing with Product with Serializable
  28. case class Tab(n: Int = 1) extends Description with Product with Serializable

    The next fragment must be indented

  29. case class Text(text: String) extends Description with Product with Serializable

    Text description

Value Members

  1. object AsExecution
  2. case object Br extends Description with Product with Serializable

    Break (== new line)

  3. object Description

    Creation methods for Descriptions

  4. case object End extends Description with Product with Serializable

    End of a block

  5. object Env extends Serializable
  6. object EnvDefault
  7. object Execution extends Serializable
  8. object FatalExecution extends Serializable
  9. object Fragment extends Serializable
  10. object Fragments extends Serializable
  11. object FragmentsContinuation extends Serializable
  12. case object NoText extends Description with Product with Serializable

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

  13. case object NotExecuting extends Executing with Product with Serializable
  14. object SpecHeader extends Serializable
  15. object SpecStructure extends Serializable

    Create SpecStructures from header, arguments, fragments

  16. object SpecificationRef extends Serializable
  17. object SpecificationStructure
  18. case object Start extends Description with Product with Serializable

    Start of a block.

    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)

Ungrouped