org.specs2.specification

core

package core

Visibility
  1. Public
  2. All

Type Members

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

    The next fragment must be un-indented

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

  3. trait ContextualSpecificationStructure extends AnyRef

  4. trait Description extends AnyRef

    Description of a Fragment

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

  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, executionTime: SimpleTimer = new SimpleTimer, 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
    • 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 ExecutionEnv(timeOut: Option[FiniteDuration] = None, withoutIsolation: Boolean = false) extends Product with Serializable

    Subset of the Env describing execution parameters

    Subset of the Env describing execution parameters

    if withoutIsolation is true then fragments are executed right away because they are already in their own copy of the specification

  8. trait ForEachEnv extends ForEach[Env]

    Specialized ForEach trait to use the Env in examples

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

    Description of a Form to be used in a Fragment

  10. 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)

  11. case class Fragments(contents: Process[Task, 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

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

  13. 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"

  14. trait Location extends AnyRef

    Location of a Fragment

    Location of a Fragment

    This is currently implemented using stacktraces which is very brittle

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

    Description of a Tag fragment

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

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

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

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

    Reference to another specification

  20. trait SpecificationStructure extends ContextualSpecificationStructure

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

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

    The next fragment must be indented

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

    Text description

Value Members

  1. object Br extends Description with Product with Serializable

    Break (== new line)

  2. object Description

    Creation methods for Descriptions

  3. object End extends Description with Product with Serializable

    End of a block

  4. object Env extends Serializable

  5. object Execution extends Serializable

  6. object ExecutionEnv extends Serializable

  7. object Fragment extends Serializable

  8. object Fragments extends Serializable

  9. object FragmentsContinuation extends Serializable

  10. object NoText extends Description with Product with Serializable

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

  11. object SpecHeader extends Serializable

  12. object SpecStructure extends Serializable

    Create SpecStructures from header, arguments, fragments

  13. object SpecificationRef extends Serializable

  14. object SpecificationStructure

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