org.specs2.specification

RegexSteps

trait RegexSteps extends AnyRef

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:

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:

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. RegexSteps
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. implicit def RegexFragmentToFragments(r: RegexFragment): Fragments

    at any point in time a regex sequence can be transformed as a sequence of Fragments

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. implicit def downcastGiven[X, Y <: X](gv: Given[Y]): Given[X] { def extract(s: String): Y }

    implicit conversion to transform a Given[Y] to Given[X] when Y <: X

  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. implicit def upcastThen[X, Y <: X](th: Then[X]): Then[Y]

    implicit conversion to transform a Then[Y] to Then[X] when Y <: X

  22. implicit def updowncastWhen[P, Q, R <: P, S >: Q](wh: When[P, Q]): When[R, S]

    implicit conversion to transform a When[P, Q] to When[R, S] when R <: P and S >: Q

  23. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  25. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any