this implicit provides an inverted syntax to adapt matchers to make the adaptation more readable in some cases: - def haveExtension(extension: =>String) = ((_:File).getPath) ^^ endWith(extension)
this implicit provides an inverted syntax to adapt matchers to make the adaptation more readable in some cases: - def haveExtension(extension: =>String) = ((_:File).getPath) ^^ endWith(extension)
Exception matcher checking the type of a thrown exception.
Exception matcher checking the type of a thrown exception.
This matchers matches exception instances.
This matchers matches exception instances.
throwA
Matcher to find if the regexp a is found inside b.
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 pattern p is found inside b.
Matcher to find if the pattern p is found inside b.
Matcher to find if the pattern p is found inside b.
Matcher to find if the pattern p is found inside b.
Matcher to find if the Regex r is found inside b.
Matcher to find if the Regex r is found inside b.
Matcher to find if the regexp a is found inside b.
Matcher to find if the regexp a is found inside b. This matcher checks if the found groups are really the ones expected
add an await
method to any matcher Matcher[T]
so that it can be transformed into a Matcher[Future[T]]
add an await
method to any matcher Matcher[T]
so that it can be transformed into a Matcher[Future[T]]
The SeqMatcher
class is a matcher matching a sequence of objects with a matcher returned by a function.
The SeqMatcher
class is a matcher matching a sequence of objects with a matcher returned by a function.
Usage: List(1, 2, 3) must ((beEqualTo(_:Int)).toSeq)(List(1, 2, 3))
The SetMatcher
class is a matcher matching a set of objects with a matcher returned by a function.
The SetMatcher
class is a matcher matching a set of objects with a matcher returned by a function.
Usage: List(1, 2, 3) must ((beEqualTo(_:Int)).toSet)(List(2, 1, 3)) }}}
implicit definition to create significant figures for the beCloseTo matcher
implicit definition to create significant figures for the beCloseTo matcher
implicit definition to create significant figures for the beCloseTo matcher
implicit definition to create significant figures for the beCloseTo matcher
when a Future contains a result, it can be awaited to return this result
when a Future contains a result, it can be awaited to return this result
Add functionalities to functions returning matchers so that they can be combined before taking a value and returning actual matchers
Add functionalities to functions returning matchers so that they can be combined before taking a value and returning actual matchers
matches if a.toLowerCase.trim != b.toLowerCase.trim
matches if a.toLowerCase.trim != b.toLowerCase.trim
matches if a != b
matches if a != b
alias for beLessThan
alias for beLessThan
alias for beLessThanOrEqualTo
alias for beLessThanOrEqualTo
matches if a.toLowerCase.trim = b.toLowerCase.trim
matches if a.toLowerCase.trim = b.toLowerCase.trim
matches if a == b
matches if a == b
matches if a == b after an implicit conversion
matches if a == b after an implicit conversion
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
alias for beGreaterThan
alias for beGreaterThan
alias for beGreaterThanOrEqualTo
alias for beGreaterThanOrEqualTo
implicit definition to create delta for the beCloseTo matcher
implicit definition to create delta for the beCloseTo matcher
implicit definition to transform any MatchResult to a Result
implicit definition to transform any MatchResult to a Result
apply a matcher atLeast one value
apply a matcher atLeast one value
verify the function f for at least one value
verify the function f for at least one value
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
apply a matcher atLeast one value
apply a matcher atLeast one value
verify the function f for at least one value
verify the function f for at least one value
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
alias for beTheSameAs
alias for beTheSameAs
alias for beOneOf
alias for beOneOf
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
matches if v.isAssignableFrom(c)
matches if v.isAssignableFrom(c)
matches if a value is between 2 others according to an Ordering
matches if a value is between 2 others according to an Ordering
matches if target - actual < 10 pow (log x - significantDigits)
matches if target - actual < 10 pow (log x - significantDigits)
matches if x = n +/- delta
matches if x = n +/- delta
matches if x = n +/- delta
matches if x = n +/- delta
matches if the partial function is defined at those values
matches if the partial function is defined at those values
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
matches if a.isEmpty
matches if a.isEmpty
matches if a == b
matches if a == b
matches if a == false
matches if a == false
matches if x > n
matches if x > n
matches if x >= n
matches if x >= n
matches if x < n
matches if x < n
matches if x <= n
matches if x <= n
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
matches if b matches the regex a
matches if b matches the regex a
matches if b matches the pattern a
matches if b matches the pattern a
matches if b matches the regular expression a
matches if b matches the regular expression a
matches if the value is null
matches if the value is null
matches if t.toSeq.exists(_ == v)
matches if t.toSeq.exists(_ == v)
a matcher checking if the elements are ordered
matches if a eq b
matches if a eq b
matches if a == true
matches if a == true
matches if a == b
matches if a == b
alias for the adventurous: 5 must (be[(2, 7)
[)
alias for the adventurous: 5 must (be[(2, 7)
[)
alias for the adventurous: 5 must (be](2, 7)
[)
alias for the adventurous: 5 must (be](2, 7)
[)
matches if a != b
matches if a != b
matches if a.toLowerCase.trim != b.toLowerCase.trim
matches if a.toLowerCase.trim != b.toLowerCase.trim
matches if a != b
matches if a != b
alias for beLessThan
alias for beLessThan
alias for beLessThanOrEqualTo
alias for beLessThanOrEqualTo
matches if a == b
matches if a == b
matches if a.toLowerCase.trim = b.toLowerCase.trim
matches if a.toLowerCase.trim = b.toLowerCase.trim
matches if a == b
matches if a == b
matches if a == b after an implicit conversion
matches if a == b after an implicit conversion
alias for beGreaterThan
alias for beGreaterThan
alias for beGreaterThanOrEqualTo
alias for beGreaterThanOrEqualTo
A value can be tested against another with the === operator.
A value can be tested against another with the === operator. It is equivalent to writing a must_== b
this method can be overridden to throw exceptions when checking the match result
this method can be overridden to throw exceptions when checking the match result
this method can be overridden to throw exceptions when checking the match result
this method can be overridden to throw exceptions when checking the match result
this method can be overridden to throw exceptions when checking the result
this method can be overridden to throw exceptions when checking the result
matches if (b contains a)
matches if (b contains a)
matches if (b contains a)
matches if (b contains a)
COLLECTION MATCHERS
COLLECTION MATCHERS
ELEMENTS MATCHERS
ELEMENTS MATCHERS
Additional contain methods using to avoid automatic tuple conversions
Additional contain methods using to avoid automatic tuple conversions
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)
match if a traversable contains one of (t1, t2)
match if a traversable contains one of (t1, t2)
match if traversable contains (x matches .*+t+.*)
match if traversable contains (x matches .*+t+.*)
match if traversable contains (x matches p)
match if traversable contains (x matches p)
does a containAll comparison in both ways
does a containAll comparison in both ways
an Expectable with a description function
an Expectable with a description function
an Expectable with a description
an Expectable
an Expectable with a function to show the element T
describe a value with the aka method
describe a value with the aka method
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
matches if b.endsWith(a)
matches if b.endsWith(a)
matches if a == b
matches if a == b
a matcher that will retry the nested matcher 40 times
a matcher that will retry the nested matcher a given number of times
matches if the regexp r is found inside b
matches if the regexp r is found inside b
matches if the pattern p is found inside b
matches if the pattern p is found inside b
matches if the regexp a is found inside b
matches if the regexp a is found inside b
apply a matcher for all values
apply a matcher for all values
verify the function f for all the values, stopping after the first failure
verify the function f for all the values, stopping after the first failure
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
apply a matcher foreach value
apply a matcher foreach value
verify the function f for all the values, and collect all failures
verify the function f for all the values, and collect all failures
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
implicit definition to accept any MatchResult as a Boolean value.
implicit definition to accept any MatchResult as a Boolean value. It is true if the MatchResult is not an Error or a Failure
This method transform a function to a Matcher
This method transform a function to a Matcher
This method transform a function, with function descriptors to a Matcher
This method transform a function, with function descriptors to a Matcher
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
This method transform a function to a Matcher
This method transform a function to a Matcher
This method transform a function to a Matcher
This method transform a function to a Matcher
matches if v.getClass == c
matches if v.getClass == c
matches if x.getClass.getInterfaces.contains(T)
matches if x.getClass.getInterfaces.contains(T)
matches if map.contains(k)
matches if map.contains(k)
matches if map.contains(k) forall key k
matches if map.contains(k) forall key k
alias for haveSize
alias for haveSize
alias for haveSize
alias for haveSize
matches if map contains a pair (key, value) == (k, v)
matches if map contains a pair (key, value) == (k, v)
matches if map contains all the specified pairs
matches if map contains all the specified pairs
match if there is a way to size T
match if there is a way to size T
match if there is a way to size T
match if there is a way to size T
matches if c.isAssignableFrom(v.getClass.getSuperclass)
matches if c.isAssignableFrom(v.getClass.getSuperclass)
matches if map contains a pair (key, value) with value == v
matches if map contains a pair (key, value) with value == v
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
any java collection has a size
any java collection has a size
alias for haveSize
alias for haveSize
alias for haveSize
alias for haveSize
this method can be overridden to intercept a MatchResult and change its message before it is thrown
this method can be overridden to intercept a MatchResult and change its message before it is thrown
This method transform a function returning a Result to a Matcher
This method transform a function returning a Result to a Matcher
a Matcher[T] can check a value
a Matcher[T] can check a value
negate a matcher
negate a matcher
This method transform a function returning a pair (Boolean, String for ko message) to a Matcher
This method transform a function returning a pair (Boolean, String for ko message) to a Matcher
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
the match result without any side-effects
any scala array has a size
any scala array has a size
any scala collection has a size
any scala collection has a size
implicit definition to transform a Seq of MatchResults to a Result
implicit definition to transform a Seq of MatchResults to a Result
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
alias for haveSize
alias for haveSize
alias for haveSize
alias for haveSize
alias for beSorted
alias for beSorted
matches if b.startsWith(a)
matches if b.startsWith(a)
a regular string has a size, without having to be converted to an Traversable
a regular string has a size, without having to be converted to an Traversable
adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher
adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher
this allows a function returning a matcher to be used where the same function with a byname parameter is expected
this allows a function returning a matcher to be used where the same function with a byname parameter is expected
this allows the contain(string) matcher for StringMatchers to be used with a Traversable
this allows the contain(string) matcher for StringMatchers to be used with a Traversable
a matcher checking the value of an Exception
a matcher checking the type of an Exception and its message (as a regexp)
a matcher checking the type of an Exception
alias for throwA
alias for throwA
alias for throwA
alias for throwA
alias for throwA
alias for throwA
matcher aliases and implicits to use with be + matcher
matcher aliases and implicits to use with be + matcher
This method transform a function returning a triplet (Boolean, String for ok message, String for ko message) to a Matcher
This method transform a function returning a triplet (Boolean, String for ok message, String for ko message) to a Matcher
matches if a == b
matches if a == b
an expected value can be used to check another value
an expected value can be used to check another value
alias for beCloseTo
alias for beCloseTo
alias for beCloseTo
alias for beCloseTo
Trait aggregating the most common specs2 matchers