Specification
Immutable Specification class
It contains all necessary functionalities to create specifications:
- create fragments
- create expectations
Type members
Inherited classlikes
Exception matcher checking the type of a thrown exception.
Exception matcher checking the type of a thrown exception.
- Inherited from:
- ExceptionMatchers
This matchers matches exception instances.
This matchers matches exception instances.
- See also:
throwA
- Inherited from:
- ExceptionMatchers
Matcher to find if the regexp a is found inside b. This matcher can be specialized to a FindMatcherWithGroups which will also check the found groups
Matcher to find if the regexp a is found inside b. This matcher can be specialized to a FindMatcherWithGroups which will also check the found groups
- Inherited from:
- StringMatchers
Matcher to find if the pattern p is found inside b.
Matcher to find if the pattern p is found inside b.
- Inherited from:
- StringMatchers
Matcher to find if the pattern p is found inside b.
Matcher to find if the pattern p is found inside b.
- Inherited from:
- StringMatchers
Matcher to find if the Regex r is found inside b.
Matcher to find if the Regex r is found inside b.
- Inherited from:
- StringMatchers
Matcher to find if the regexp a is found inside b. This matcher checks if the found groups are really the ones expected
Matcher to find if the regexp a is found inside b. This matcher checks if the found groups are really the ones expected
- Inherited from:
- StringMatchers
- Inherited from:
- FragmentsDsl
implicit definition to accept any boolean value as a Result This avoids writing b must beTrue
implicit definition to accept any boolean value as a Result This avoids writing b must beTrue
- Inherited from:
- Results
- Inherited from:
- S2StringContext
- Inherited from:
- S2StringContext
- Inherited from:
- SpecStructureDsl
- Inherited from:
- SpecStructureDsl
- Inherited from:
- SpecStructureDsl
- Inherited from:
- SpecStructureDsl
- Inherited from:
- SpecStructureDsl
Value members
Inherited methods
matches if a.toLowerCase.trim != b.toLowerCase.trim
matches if a.toLowerCase.trim != b.toLowerCase.trim
- Inherited from:
- StringMatchers
matches if a.toLowerCase.trim = b.toLowerCase.trim
matches if a.toLowerCase.trim = b.toLowerCase.trim
- Inherited from:
- StringMatchers
matches if a == b after an implicit conversion
matches if a == b after an implicit conversion
- Inherited from:
- AnyMatchers
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
- Inherited from:
- StringMatchers
alias for beOneOf, which can be used with contain matchers
alias for beOneOf, which can be used with contain matchers
- Inherited from:
- AnyMatchers
shorthand method to create an Arguments object
shorthand method to create an Arguments object
- Inherited from:
- ArgumentsCreation
verify the function f for at least one value, where the PartialFunction is defined
verify the function f for at least one value, where the PartialFunction is defined
- Inherited from:
- MatcherImplicits
verify the function f for at least one value, where the PartialFunction is defined
verify the function f for at least one value, where the PartialFunction is defined
- Inherited from:
- MatcherImplicits
- Returns:
arguments for a specification where examples must in a given batch size
- Inherited from:
- ArgumentsShortcuts
matches if a is null when v is null and a is not null when v is not null
matches if a is null when v is null and a is not null when v is not null
- Inherited from:
- AnyMatchers
matches if a value is between 2 others according to an Ordering
matches if a value is between 2 others according to an Ordering
- Inherited from:
- NumericMatchers
matches if target - actual < 10 pow (log actual - significantDigits)
matches if target - actual < 10 pow (log actual - significantDigits)
- Inherited from:
- NumericMatchers
matches if the partial function is defined at those values
matches if the partial function is defined at those values
- Inherited from:
- MapMatchers
matches if the partial function is defined at those values and return expected values
matches if the partial function is defined at those values and return expected values
- Inherited from:
- MapMatchers
check if a Throwable has a specific class and error message The message must be a regular expression, for example (new IllegalArgumentException("incorrect arguments"): Throwable) must beExceptionIllegalArgumentException
check if a Throwable has a specific class and error message The message must be a regular expression, for example (new IllegalArgumentException("incorrect arguments"): Throwable) must beExceptionIllegalArgumentException
- Inherited from:
- ExceptionMatchers
matches if the value returns a successful result when applied to a PartialFunction
matches if the value returns a successful result when applied to a PartialFunction
- Inherited from:
- AnyMatchers
matches if b matches the regular expression a
matches if b matches the regular expression a
- Inherited from:
- StringMatchers
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
- Inherited from:
- StringMatchers
matches if a.toLowerCase.trim != b.toLowerCase.trim
matches if a.toLowerCase.trim != b.toLowerCase.trim
- Inherited from:
- StringMatchers
matches if a.toLowerCase.trim = b.toLowerCase.trim
matches if a.toLowerCase.trim = b.toLowerCase.trim
- Inherited from:
- StringMatchers
matches if a == b after an implicit conversion
matches if a == b after an implicit conversion
- Inherited from:
- AnyMatchers
this method can be overridden to throw exceptions when checking a result
this method can be overridden to throw exceptions when checking a result
- Inherited from:
- ResultChecks
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
- Inherited from:
- TraversableBaseMatchers
Additional contain methods using to avoid automatic tuple conversions
Additional contain methods using to avoid automatic tuple conversions
- Inherited from:
- TraversableBaseMatchers
match if a traversable contains all the elements of seq (and maybe more)
match if a traversable contains all the elements of seq (and maybe more)
- Inherited from:
- TraversableBaseMatchers
match if a traversable contains one of (t1, t2)
match if a traversable contains one of (t1, t2)
- Inherited from:
- TraversableBaseMatchers
match if traversable contains (x matches .+t+.)
match if traversable contains (x matches .+t+.)
- Inherited from:
- TraversableBaseMatchers
match if traversable contains (x matches p)
match if traversable contains (x matches p)
- Inherited from:
- TraversableBaseMatchers
does a containAll comparison in both ways
does a containAll comparison in both ways
- Inherited from:
- TraversableBaseMatchers
shortcut to display the differences with some specific parameters
shortcut to display the differences with some specific parameters
- Inherited from:
- ArgumentsShortcuts
- Returns:
a matcher that will retry the nested matcher a given number of times
- Inherited from:
- EventuallyMatchers
- Value parameters:
- sleep
the function applied on the retry number (first is 1)
- Returns:
a matcher that will retry the nested matcher a given number of times
- Inherited from:
- EventuallyMatchers
- Returns:
a matcher that will retry the nested matcher a given number of times
- Inherited from:
- EventuallyResults
- Value parameters:
- sleep
the function applied on the retry number (first is 1)
- Returns:
a matcher that will retry the nested matcher a given number of times
eventually(retries = 2, sleep = _ * 100.milliseconds) { aResult }
- Inherited from:
- EventuallyResults
shortcut to exclude some tagged fragments
shortcut to exclude some tagged fragments
- Inherited from:
- ArgumentsShortcuts
shortcut to add exclude trace patterns
shortcut to add exclude trace patterns
- Inherited from:
- ArgumentsShortcuts
shortcut to create a stackTrace filter to exclude only some elements
shortcut to create a stackTrace filter to exclude only some elements
- Inherited from:
- ArgumentsShortcuts
matches if the regexp r is found inside b
matches if the regexp r is found inside b
- Inherited from:
- StringMatchers
matches if the pattern p is found inside b
matches if the pattern p is found inside b
- Inherited from:
- StringMatchers
matches if the regexp a is found inside b
matches if the regexp a is found inside b
- Inherited from:
- StringMatchers
verify the function f for all the values, stopping after the first failure, where the PartialFunction is defined
verify the function f for all the values, stopping after the first failure, where the PartialFunction is defined
- Inherited from:
- MatcherImplicits
- Inherited from:
- MatcherImplicits
verify the function f for all the values, and collect all failures
verify the function f for all the values, and collect all failures
- Inherited from:
- MatcherImplicits
verify the function f for all the values, and collect all failures, where the PartialFunction is defined
verify the function f for all the values, and collect all failures, where the PartialFunction is defined
- Inherited from:
- MatcherImplicits
create a block of new fragments where each of them is separated by a newline and there is a specific offset from the left margin
create a block of new fragments where each of them is separated by a newline and there is a specific offset from the left margin
- Inherited from:
- FragmentsDsl
matches if x.getClass.getInterfaces.contains(T)
matches if x.getClass.getInterfaces.contains(T)
- Inherited from:
- AnyMatchers
matches if map.contains(k) forall key k
matches if map.contains(k) forall key k
- Inherited from:
- MapMatchers
matches if map contains a pair (key, value) == (k, v)
matches if map contains a pair (key, value) == (k, v)
- Inherited from:
- MapMatchers
matches if map contains all the specified pairs
matches if map contains all the specified pairs
- Inherited from:
- MapMatchers
match if there is a way to size T
match if there is a way to size T
- Inherited from:
- TraversableBaseMatchers
match if there is a way to size T
match if there is a way to size T
- Inherited from:
- TraversableBaseMatchers
matches if c.isAssignableFrom(v.getClass.getSuperclass)
matches if c.isAssignableFrom(v.getClass.getSuperclass)
- Inherited from:
- AnyMatchers
matches if map contains a pair (key, value) with value == v
matches if map contains a pair (key, value) with value == v
- Inherited from:
- MapMatchers
matches if map contains a pair (key, value) with value == v for all value v
matches if map contains a pair (key, value) with value == v for all value v
- Inherited from:
- MapMatchers
shortcut to include only some tagged fragments
shortcut to include only some tagged fragments
- Inherited from:
- ArgumentsShortcuts
shortcut to add include trace patterns
shortcut to add include trace patterns
- Inherited from:
- ArgumentsShortcuts
shortcut to create a stackTrace filter to include only some elements
shortcut to create a stackTrace filter to include only some elements
- Inherited from:
- ArgumentsShortcuts
modify the specification structure
modify the specification structure
- Inherited from:
- SpecificationStructure
this method can be overridden to intercept a Result and modify it. It is used for example to set a stacktrace providing the location of a failure
this method can be overridden to intercept a Result and modify it. It is used for example to set a stacktrace providing the location of a failure
- Inherited from:
- ResultChecks
shortcut to execute and print only some examples
shortcut to execute and print only some examples
- Inherited from:
- ArgumentsShortcuts
shortcut to show only the text without any execution
shortcut to show only the text without any execution
- Inherited from:
- ArgumentsShortcuts
this function is introduced just to allow the mutable specification to register the newly created fragments
this function is introduced just to allow the mutable specification to register the newly created fragments
- Inherited from:
- AutoExamples
this function is exposed so that it can be overridden with side-effects when using s2 strings in mutable specs
this function is exposed so that it can be overridden with side-effects when using s2 strings in mutable specs
- Inherited from:
- S2StringContextCreation
- Returns:
arguments for a specification where examples must be executed sequentially
- Inherited from:
- ArgumentsShortcuts
- Returns:
arguments for a specification where examples must be executed sequentially but in a random order
- Inherited from:
- ArgumentsShortcuts
this method can be overridden to avoid filling-in a stacktrace indicating the location of the result
this method can be overridden to avoid filling-in a stacktrace indicating the location of the result
- Inherited from:
- MatchResultStackTrace
shortcut to print only some statuses
shortcut to print only some statuses
- Inherited from:
- ArgumentsShortcuts
shortcut to skip all examples when a condition is true. if the condition throws an exception, its stacktrace is not printed and all the examples are skipped
shortcut to skip all examples when a condition is true. if the condition throws an exception, its stacktrace is not printed and all the examples are skipped
- Inherited from:
- ArgumentsShortcuts
shortcut to skip all examples when a condition is false.
shortcut to skip all examples when a condition is false.
- Inherited from:
- ArgumentsShortcuts
shortcut to stop after the first failure or error
shortcut to stop after the first failure or error
- Inherited from:
- ArgumentsShortcuts
shortcut to stop after the first skipped result
shortcut to stop after the first skipped result
- Inherited from:
- ArgumentsShortcuts
- Returns:
a matcher checking the type of an Exception and its message (as a regexp)
- Inherited from:
- ExceptionMatchers
- Returns:
arguments for a specification where examples must be executed inside just one big batch
- Inherited from:
- ArgumentsShortcuts
an expected value can be used to check another value
an expected value can be used to check another value
- Inherited from:
- ValueChecksBase
shortcut to include only examples with some previous statuses
shortcut to include only examples with some previous statuses
- Inherited from:
- ArgumentsShortcuts
shortcut to print only failures and errors
shortcut to print only failures and errors
- Inherited from:
- ArgumentsShortcuts
Givens
Inherited givens
a check of type T can be downcasted implicitly to a check of type S >: T
a check of type T can be downcasted implicitly to a check of type S >: T
- Inherited from:
- ValueChecks
if an implicit execution environment is in scope, it can be used as an execution context
if an implicit execution environment is in scope, it can be used as an execution context
- Inherited from:
- ImplicitExecutionContextFromExecutionEnv
a function returning an object having an AsResult instance can check a value
a function returning an object having an AsResult instance can check a value
- Inherited from:
- ValueChecksLowImplicits
implicit definition to accept any boolean value as a Result This avoids writing b must beTrue
implicit definition to accept any boolean value as a Result This avoids writing b must beTrue
- Inherited from:
- Results
implicit definition to create delta for the beCloseTo matcher
implicit definition to create delta for the beCloseTo matcher
- Inherited from:
- NumericMatchers
The FragmentFactory has to be passed as an implicit in order to be inlined in macros
The FragmentFactory has to be passed as an implicit in order to be inlined in macros
- Inherited from:
- S2StringContextCreation
- Inherited from:
- SpecStructureDsl
- Inherited from:
- SpecStructureDsl
APPENDING TO A SPEC HEADER
APPENDING TO A SPEC HEADER
- Inherited from:
- SpecStructureDsl
- Inherited from:
- SpecStructureDsl
- Inherited from:
- SpecStructureDsl
a partial function returning an object having an AsResult instance can check a value
a partial function returning an object having an AsResult instance can check a value
- Inherited from:
- ValueChecks
Extensions
Inherited extensions
- Inherited from:
- ExpectationsDescription
- Inherited from:
- ExpectationsDescription
this extension provides an inverted syntax to adapt matchers to make the adaptation more readable in some cases:
this extension provides an inverted syntax to adapt matchers to make the adaptation more readable in some cases:
- def haveExtension(extension: =>String) = ((_:File).getPath) ^^ endWith(extension)
- Inherited from:
- MatcherImplicits
adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher
adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher
- Inherited from:
- StringMatchers
adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher
adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher
- Inherited from:
- StringMatchers
String interpolation for specs2 fragments
String interpolation for specs2 fragments
- Inherited from:
- S2StringContextCreation
print the object to the console with a small message before
print the object to the console with a small message before
- Inherited from:
- Debug
print the object to the console with a specific function and return it
print the object to the console with a specific function and return it
- Inherited from:
- Debug
print the object to the console and return it, if the condition is satisfied
print the object to the console and return it, if the condition is satisfied
- Inherited from:
- Debug
print the object to the console and return it, if the condition is satisfied
print the object to the console and return it, if the condition is satisfied
- Inherited from:
- Debug
- Returns:
Pending unless the result is a success
- Inherited from:
- PendingUntilFixed
- Returns:
Pending unless the result is a success
- Inherited from:
- PendingUntilFixed
implicit definition to create significant figures for the beCloseTo matcher
implicit definition to create significant figures for the beCloseTo matcher
- Inherited from:
- NumericMatchers
- Returns:
an expectable with its toString method as an alias description this is useful to preserve the original value when the matcher using it is adapting the value
- Inherited from:
- ExpectationsDescription
- Returns:
an expectable with an alias description, after the value string
- Inherited from:
- ExpectationsDescription
- Returns:
an expectable with an alias description, after the value string
- Inherited from:
- ExpectationsDescription
Extend collections to check all their elements
Extend collections to check all their elements
- Inherited from:
- MatcherImplicits
Extend collections to check all their elements
Extend collections to check all their elements
- Inherited from:
- MatcherImplicits
Extend collections to check all their elements
Extend collections to check all their elements
- Inherited from:
- MatcherImplicits
Extend collections to check all their elements
Extend collections to check all their elements
- Inherited from:
- MatcherImplicits
Extend collections to check all their elements
Extend collections to check all their elements
- Inherited from:
- MatcherImplicits
Extend collections to check all their elements
Extend collections to check all their elements
- Inherited from:
- MatcherImplicits
Extend collections to check all their elements
Extend collections to check all their elements
- Inherited from:
- MatcherImplicits
Extend collections to check all their elements
Extend collections to check all their elements
- Inherited from:
- MatcherImplicits
Extend collections to check all their elements
Extend collections to check all their elements
- Inherited from:
- MatcherImplicits
Implicits
Inherited implicits
- Inherited from:
- FragmentsDsl
- Inherited from:
- SpecStructureDsl
create an example based on an execution
create an example based on an execution
- Inherited from:
- S2StringContext
- Inherited from:
- S2StringContext1 (hidden)
- Inherited from:
- ShouldExpectations
- Inherited from:
- ShouldExpectations
- Inherited from:
- S2StringContext1 (hidden)
- Inherited from:
- S2StringContext1 (hidden)
- Inherited from:
- ArgProperties