org.specs2

specification

package specification

Visibility
  1. Public
  2. All

Type Members

  1. abstract class Given[T] extends RegexExtractor[Unit, T]

    This step can start a sequence of Given / When / Then.

    This step can start a sequence of Given / When / Then.

    It must define the extract function creating a value of type T from the extracted values

  2. abstract class GivenThen extends RegexExtractor[String, Result]

  3. class GivenThenFunction[R] extends GivenThen

  4. trait GivenWhenThen extends RegexStepsFactory with TuplesToSeq with FragmentsBuilder with SpecificationStringContext with ArgumentsArgs

    This trait provides building blocks to create steps and examples from regular expression.

    This trait provides building blocks to create steps and examples from regular expression.

    It is used to implement a Given-When-Then way of describing systems.

    Fragments are created by adding a Given step to a Text:

    "name: ${user}" ^ givenName

    This creates a PreStep object containing the current context (representing all the extracted values) and a list of Fragments containing:

    • the Text fragment: Text("name: ${user}")
    • a Step containing the extraction code to get the value delimited by ${}

    Then, this PreStep object can be followed by another piece of Text to create a PreStepText object. This object merely stores the additional Text fragment so that values can be extracted from it when a When step is added:

    // this creates a PreStepText object
    "name: ${user}" ^ givenName ^
    "age: ${38}"
    
    // this creates a PreStep object
    "name: ${user}" ^ givenName ^
    "age: ${38}"    ^ thenAge ^

    Eventually, when a Then step is added, a sequence of PostStep/PostStepText objects is created. Those objects use the current context and the results returned by the Then objects to create Examples.

    The last PostStep object contains the list of all fragments created by the Given/When/Then sequence:

    • Text fragments
    • Steps
    • Examples
  5. trait RegexFragment extends AnyRef

  6. trait RegexStepsFactory extends ImplicitParameters

  7. abstract class Then[T] extends RegexExtractor[Either[Result, T], (T, Result)]

    This step define checks in a sequence of Given / When / Then.

    This step define checks in a sequence of Given / When / Then.

    It must define the extract function taking the state of extracted values, T, and return a Result

  8. abstract class When[P, T] extends RegexExtractor[P, T]

    This step define conditions in a sequence of Given / When / Then.

    This step define conditions in a sequence of Given / When / Then.

    It must define the extract function taking the previous state of extracted values, P, and creating a new state of type T from the extracted values

Value Members

  1. object Given extends ImplicitParameters

    implicit conversions to create Given objects

  2. object Then extends ImplicitParameters

    implicit conversions to create Then objects

  3. object When extends ImplicitParameters

    implicit conversions to create When objects

  4. package gen

  5. package script

  6. object so

Ungrouped