org.specs2.specification

Type members

Classlikes

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

Companion
object
object After
Companion
class

Run a given fragment after each fragment

Run a given fragment after each fragment

Execute some fragments after all others

Execute some fragments after all others

trait AllExpectations extends SpecificationStructure with StoredExpectations with ArgumentsCreation with StandardResults

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 must run sequentially

If the specification is not sequential we force it to be

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

Companion
object
object Around
Companion
class

Run a function around each execution result

Run a function around each execution result

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

Companion
object
object Before
Companion
class
trait BeforeAfter extends Before with After
Companion
object
object BeforeAfter
Companion
class

Run a given fragment before and after each fragment

Run a given fragment before and after each fragment

Execute some fragments before and after all others

Execute some fragments before and after all others

Run a given fragment before each fragment

Run a given fragment before each fragment

Execute some fragments before all others

Execute some fragments before all others

trait Context

generic trait for Before, After, Around

generic trait for Before, After, Around

Companion
object
object Context
Companion
class
trait ForEach[T]

For each created example use a given fixture object

For each created example use a given fixture object

Acquire a resource for the whole spec and release it at the end

Acquire a resource for the whole spec and release it at the end

trait Retries extends AroundEach
trait Snippets extends 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.

Companion
object
object Snippets
Companion
class
trait SpecificationFeatures extends MustMatchers with ShouldMatchers with Expectations with StandardResults with ExpectedResults with MatcherImplicits with ResultLogicalCombinators 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
trait StoredExpectations extends Expectations with StandardResults

This trait evaluates expectations and stores them in a local variable for further usage

This trait evaluates expectations and stores them in a local variable for further usage

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. However the syntax for creating examples with a String and a ! is deactivated

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

Companion
object
object Tables extends Tables with Expectations
Companion
class