Package

org.specs2.specification

core

Permalink

package core

Visibility
  1. Public
  2. All

Type Members

  1. trait AsExecution[T] extends AnyRef

    Permalink
  2. case class Backtab(n: Int = 1) extends Description with Product with Serializable

    Permalink

    The next fragment must be un-indented

  3. case class Code(text: String) extends Description with Product with Serializable

    Permalink
  4. trait ContextualSpecificationStructure extends AnyRef

    Permalink
    Annotations
    @EnableReflectiveInstantiation()
  5. trait Description extends AnyRef

    Permalink

    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

    Permalink

    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

    Permalink
  8. case class Execution(run: Option[(Env) ⇒ Future[() ⇒ Result]] = None, executing: Option[Either[Throwable, Future[Result]]] = None, timeout: Option[FiniteDuration] = None, mustJoin: Boolean = false, nextMustStopIf: (Result) ⇒ Boolean = (r: Result) => false, isolable: Boolean = true, previousResult: Option[Result] = None, timer: SimpleTimer = new SimpleTimer, continuation: Option[FragmentsContinuation] = None) extends Product with Serializable

    Permalink

    Execution of a Fragment

    Execution of a Fragment

    • there can be none (for a piece of text)
    • the execution depends on the current Env
    • 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 stores its execution time
    • it can store a continuation that will create more fragments, possibly containing more executions, based on the current result
  9. case class ExecutionParameters(timeout: Option[FiniteDuration] = None, withIsolation: Boolean = true) extends Product with Serializable

    Permalink
  10. case class FatalExecution(t: Throwable) extends Exception with Product with Serializable

    Permalink
  11. case class Fragment(description: Description, execution: Execution, location: Location = StacktraceLocation()) extends Product with Serializable

    Permalink

    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)

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

    Permalink

    Fragments of a specification

    Fragments of a specification

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

  13. case class FragmentsContinuation(continue: (Result) ⇒ Option[Fragments]) extends Product with Serializable

    Permalink

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

  14. trait ImmutableSpecificationStructure extends SpecificationStructure

    Permalink

    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"

  15. trait Location extends AnyRef

    Permalink

    Location of a Fragment

    Location of a Fragment

    This is currently implemented using stacktraces which is very brittle

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

    Permalink

    Description of a Tag fragment

  17. trait OwnEnv extends AfterAll

    Permalink

    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

  18. trait OwnExecutionEnv extends AfterAll

    Permalink

    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

  19. case class SimpleLocation(trace: TraceLocation) extends Location with Product with Serializable

    Permalink
  20. case class SpecHeader(specClass: Class[_], title: Option[String] = None) extends Product with Serializable

    Permalink

    Header of a Specification

    Header of a Specification

    It can hold a user-defined title for better presentation

  21. case class SpecStructure(header: SpecHeader, arguments: Arguments, lazyFragments: () ⇒ Fragments) extends Product with Serializable

    Permalink

    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

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

    Permalink

    Reference to another specification

  23. trait SpecificationStructure extends ContextualSpecificationStructure

    Permalink
  24. case class StacktraceLocation(trace: Seq[StackTraceElement] = new Exception).getStackTrace) extends Location with Product with Serializable

    Permalink
  25. case class Tab(n: Int = 1) extends Description with Product with Serializable

    Permalink

    The next fragment must be indented

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

    Permalink

    Text description

Value Members

  1. object AsExecution

    Permalink
  2. object Br extends Description with Product with Serializable

    Permalink

    Break (== new line)

  3. object Description

    Permalink

    Creation methods for Descriptions

  4. object End extends Description with Product with Serializable

    Permalink

    End of a block

  5. object Env extends Serializable

    Permalink
  6. object EnvDefault

    Permalink
  7. object Execution extends Serializable

    Permalink
  8. object FatalExecution extends Serializable

    Permalink
  9. object Fragment extends Serializable

    Permalink
  10. object Fragments extends Serializable

    Permalink
  11. object FragmentsContinuation extends Serializable

    Permalink
  12. object NoText extends Description with Product with Serializable

    Permalink

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

  13. object SpecHeader extends Serializable

    Permalink
  14. object SpecStructure extends Serializable

    Permalink

    Create SpecStructures from header, arguments, fragments

  15. object SpecificationRef extends Serializable

    Permalink
  16. object SpecificationStructure

    Permalink
  17. object Start extends Description with Product with Serializable

    Permalink

    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