Packages

p

org.specs2

specification

package specification

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. trait After extends Context

    The After trait can be inherited by classes representing a context where an action must be executing after the main executable action

    The After trait can be inherited by classes representing a context where an action must be executing after the main executable action

    See also

    Example to understand why the type T must : AsResult

  2. trait AfterAll extends SpecificationStructure with FragmentsFactory

    Execute a step after all fragments

  3. trait AfterEach extends FragmentsFactory

    For each created example use a given after action

  4. trait AfterSpec extends SpecificationStructure

    Execute some fragments after all others

  5. trait AllExpectations extends StoredExpectations with FragmentsFactory with SpecificationStructure with ArgumentsCreation

    This trait can be mixed-in a specification to allow examples to have all of their expectations being evaluated (unless the example body throws an exception of course).

    This trait can be mixed-in a specification to allow examples to have all of their expectations being evaluated (unless the example body throws an exception of course).

    All the results are collected into a list, provided by the StoredExpectations trait. These results form then the body of the each example (decorated by a special ExampleFactory) so that each example returns a Result which is the summary of all the individual issues.

    It must be noted that this trait relies on a mutable list to collect the results as they are created in the example body. Because of this restriction, a Specification using that trait can either run sequentially or isolated.

    If the specification is neither sequential or isolated, we force it to be isolated by default.

  6. trait Analysis extends DependencyMatchers with FragmentsDsl

    This trait provides integrated dependency analysis method for a Scala project

  7. trait Around extends Context

    The Around trait can be inherited by classes which will execute some code inside the around method provided by the context.

    The Around trait can be inherited by classes which will execute some code inside the around method provided by the context.

    This can be used for example to execute some code inside a webapp session

    See also

    Example to understand why the type T must : AsResult

  8. trait AroundEach extends FragmentsFactory

    For each created example use a given around action

  9. trait AroundTimeout extends AnyRef
  10. trait Before extends Context

    The Before trait can be inherited by classes representing a context where an action must be executing before the main executable action

    The Before trait can be inherited by classes representing a context where an action must be executing before the main executable action

    See also

    Example to understand why the type T must : AsResult

  11. trait BeforeAfter extends Before with After
  12. trait BeforeAfterAll extends SpecificationStructure with FragmentsFactory

    Execute a step before and after all fragments

  13. trait BeforeAfterEach extends FragmentsFactory

    For each created example use a given before action

  14. trait BeforeAfterSpec extends SpecificationStructure

    Execute some fragments before and after all others

  15. trait BeforeAll extends SpecificationStructure with FragmentsFactory

    Execute a step before all fragments

  16. trait BeforeEach extends FragmentsFactory

    For each created example use a given before action

  17. trait BeforeSpec extends SpecificationStructure

    Execute some fragments before all others

  18. trait Context extends Scope

    generic trait for Before, After, Around

  19. trait ContextWithCommandLineArguments extends FragmentsFactory

    For each created example use a context using the command line arguments

  20. trait EachContext extends FragmentsFactory

    For each created example use a given context

  21. case class ExamplesGroup(name: String = "") extends Product with Serializable
  22. trait ExamplesTimeout extends EachContext with AroundTimeout

    This trait can be used to add a global time out to each example or for a specific one:

    This trait can be used to add a global time out to each example or for a specific one:

    • for each example mix-in the trait
    • for a single example import the object and use the upTo context:

    my example must terminate in a reasonable amount of time ${upTo(3.seconds)(e1)}

  23. class ExecutionVar extends AnyRef
  24. trait Fixture[T] extends AnyRef

    A Fixture can be implicitly passed to a set of examples taking a function as an input.

    A Fixture can be implicitly passed to a set of examples taking a function as an input.

    It can effectively act as a parameterized Around context

  25. trait ForEach[T] extends FragmentsFactory

    For each created example use a given fixture object

  26. trait ForEachWithCommandLineArguments[T] extends FragmentsFactory

    For each example but inject data depending on command line arguments

  27. trait Forms extends FormsBuilder with FormFragmentsFactory with DecoratedProperties with FormS2StringContext with FormDsl with PropSyntax

    Allow a Form to be inserted among Fragments as a Text Fragment Allow a Form to be used as an example body and return a Result automatically

  28. trait Grouped extends GroupsLike

    This trait can be used to standardize names for groups of examples in an acceptance specification.

    This trait can be used to standardize names for groups of examples in an acceptance specification.

    class MySpecification extends Specification with Examples { def is = s2""" first example in first group ${g1.e1} second example in first group ${g1.e2}

    first example in second group ${g2.e1} second example in second group ${g2.e2} """ }

    trait Examples extends Grouped with Matchers { "first group of examples" - new g1 { e1 := ok e2 := ok } "second group of examples" - new g2 { e1 := ok e2 := ok } }

    If you don't want to manage groups and examples numbers it is also possible to write the following (note the script.Specification):

    class MySpecification extends script.Specification with Examples { def is = s2""" first example in first group second example in first group

    first example in second group second example in second group """ }

    trait Examples extends Grouped with Matchers { "first group of examples" - new group { eg := ok eg := ok } "second group of examples" - new group { eg := ok eg := ok } }

  29. trait Groups extends GroupsLike

    This trait can be used to standardize names for groups of examples in an acceptance specification.

    This trait can be used to standardize names for groups of examples in an acceptance specification.

    class MySpecification extends Specification with Examples { def is = s2""" first example in first group ${g1().e1} second example in first group ${g1().e2}

    first example in second group ${g2().e1} second example in second group ${g2().e2} """ }

    trait Examples extends Groups with Matchers { "first group of examples" - new g1 { e1 := ok e2 := ok } "second group of examples" - new g2 { e1 := ok e2 := ok } }

    It is important to notice that the examples must be called with g1().e1 so as to create a new g1 trait instance with new local variables for the example e1. If this is not required, the Grouped trait can be used instead

    If you don't want to manage groups and examples numbers it is also possible to write the following (note the script.Specification):

    class MySpecification extends script.Specification with Examples { def is = s2""" first example in first group second example in first group

    first example in second group second example in second group """ }

    trait Examples extends Groups with Matchers { "first group of examples" - new group { eg := ok eg := ok } "second group of examples" - new group { eg := ok eg := ok } }

  30. trait GroupsLike extends AnyRef
  31. class ResultsContext extends StoredResultsContext

    This class is used to evaluate a Context as a sequence of results by side-effects.

    This class is used to evaluate a Context as a sequence of results by side-effects.

    See also

    the AllExpectations trait for its use

  32. trait Retries extends AroundEach
  33. trait Scope extends matcher.Scope

    Marker trait that is used to create a new scope with variables and implicitly converted to a Success in a mutable Specification

  34. trait Snippets extends execute.Snippets

    Snippets of code can be extracted from interpolated specification strings.

    Snippets of code can be extracted from interpolated specification strings.

    When you want to specify that a piece of code must be included in the specification output, you can use the snippet method to execute a this code and use the text in the output. If you just want to output part of the code you need to delimit it with some comments // 8<------- (with as many dashes as you want)

    Generally the last value of a snippet will be displayed separately but it is possible to avoid this by using the mute method on a Snippet.

    It is also possible to check that the result value is equal to a specific value by using the check[R : AsResult](f: T => R) method.

  35. trait SpecificationFeatures extends MustMatchers with ShouldMatchers with StandardResults with StandardMatchResults with PendingUntilFixed with ImplicitParameters with Debug with ImplicitExecutionContexts

    List of all the features which are being included the default Specification class:

    List of all the features which are being included the default Specification class:

    • matchers (with the expectations dsl and the most common matchers)
    • standard results
    • pending until fixed
    • implicit parameters to overload some method calls
    • .pp calls to print out some expressions
  36. trait StoredExpectationsContext extends StoredExpectations with StoredResultsContext

    This trait can be used when it is not desirable to use the AllExpectations trait, that is, when the specification examples must be executed concurrently and not isolated.

    This trait can be used when it is not desirable to use the AllExpectations trait, that is, when the specification examples must be executed concurrently and not isolated.

    See also

    the UserGuide on how to use this trait

  37. trait StoredResultsContext extends Context

    This trait is a context which will use the results provided by the class inheriting that trait.

    This trait is a context which will use the results provided by the class inheriting that trait. It evaluates the result of an example, which is supposed to create side-effects and returns the 'storedResults' as the summary of all results

  38. trait Tables extends DataTables with NoBangExamples

    This trait allows to use Data tables with simple ! as column separator when the first column is a string.

    This trait allows to use Data tables with simple ! as column separator when the first column is a string. However the syntax for creating examples with a String and a ! is deactivated

Value Members

  1. object After
  2. object Around
  3. object AroundTimeout extends AroundTimeout
  4. object Before
  5. object BeforeAfter
  6. object Context
  7. object ExamplesTimeout extends ExamplesTimeout
  8. object ExecutionVar
  9. object Fixture
  10. object Forms extends Forms
  11. object Tables extends Tables with Expectations

Ungrouped