Package

org.specs2.specification

core

Permalink

package core

Visibility
  1. Public
  2. All

Type Members

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

    Permalink

    The next fragment must be un-indented

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

    Permalink
  3. trait ContextualSpecificationStructure extends AnyRef

    Permalink
  4. trait Description extends AnyRef

    Permalink

    Description of a Fragment

  5. case class Env(arguments: Arguments = Arguments(), selectorInstance: (Arguments) ⇒ Selector = ..., executorInstance: (Arguments) ⇒ Executor = ..., lineLogger: LineLogger = NoLineLogger, statsRepository: (Arguments) ⇒ StatisticsRepository = ..., systemLogger: Logger = noLogging, random: Random = new scala.util.Random, fileSystem: FileSystem = FileSystem, executionParameters: ExecutionParameters = ExecutionParameters()) 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

  6. case class Execution(run: Option[(Env) ⇒ Result], executed: Option[Result] = None, timeout: Option[FiniteDuration] = None, mustJoin: Boolean = false, nextMustStopIf: (Result) ⇒ Boolean = (r: Result) => false, isolable: Boolean = true, previousResult: Option[Result] = None, fatal: Option[FatalExecution] = None, executionTime: 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
  7. case class ExecutionParameters(timeout: Option[FiniteDuration] = None, withoutIsolation: Boolean = false) extends Product with Serializable

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

    Permalink
  9. trait ForEachEnv extends ForEach[Env]

    Permalink

    Specialized ForEach trait to use the Env in examples

  10. case class FormDescription(form: () ⇒ Form) extends Description with Product with Serializable

    Permalink

    Description of a Form to be used in a Fragment

  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: Process[Task, 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. case class SimpleLocation(trace: TraceLocation) extends Location with Product with Serializable

    Permalink
  18. 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

  19. 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

  20. 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

  21. trait SpecificationStructure extends ContextualSpecificationStructure

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

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

    Permalink

    The next fragment must be indented

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

    Permalink

    Text description

Value Members

  1. object Br extends Description with Product with Serializable

    Permalink

    Break (== new line)

  2. object Description

    Permalink

    Creation methods for Descriptions

  3. object End extends Description with Product with Serializable

    Permalink

    End of a block

  4. object Env extends Serializable

    Permalink
  5. object Execution extends Serializable

    Permalink
  6. object Fragment extends Serializable

    Permalink
  7. object Fragments extends Serializable

    Permalink
  8. object FragmentsContinuation extends Serializable

    Permalink
  9. object NoText extends Description with Product with Serializable

    Permalink

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

  10. object SpecHeader extends Serializable

    Permalink
  11. object SpecStructure extends Serializable

    Permalink

    Create SpecStructures from header, arguments, fragments

  12. object SpecificationRef extends Serializable

    Permalink
  13. object SpecificationStructure

    Permalink
  14. 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