ExceptionMatcher
An exception matcher checks if an expression throws some specified exceptions:
- by checking the type of exception
- if no exception is thrown it returns a success
- if an exception is thrown with with a subtype of java.lang.Error and we expect an Exception then it is re-thrown
- if an exception is thrown with a different type it returns a failure
- by checking the exception message
- by checking a condition on the exception
Attributes
- Graph
-
- Supertypes
- Self type
Members list
Value members
Concrete methods
apply this matcher to an Expectable
apply this matcher to an Expectable
Attributes
- Returns
-
a Result describing the outcome of the match
Specify an additional condition to check on a thrown exception
Specify an additional condition to check on a thrown exception
Attributes
Negate the exception matcher to assert that an exception must not be thrown
Negate the exception matcher to assert that an exception must not be thrown
- if no exception is thrown this is a success
- if an exception is thrown with the specified type, it is a failure
- if an exception is thrown with a different type, the exception is re-thrown in order to be interpreted as a programming error by the library
Attributes
- Definition Classes
Inherited methods
Adapt a matcher to another. ex: be_==("message") ^^ (_.getMessage aka "trimmed")
can be applied to an exception
Adapt a matcher to another. ex: be_==("message") ^^ (_.getMessage aka "trimmed")
can be applied to an exception
The dummy value is used to help to disambiguate with the overloaded ^^ function
Attributes
- Inherited from:
- Matcher
Adapt a matcher to another. ex: be_==("message") ^^ (_.getMessage)
can be applied to an exception
Adapt a matcher to another. ex: be_==("message") ^^ (_.getMessage)
can be applied to an exception
Attributes
- Inherited from:
- Matcher
the logical and between 2 matchers
Value parameters
- sleep
-
the function applied on the retry number (first is 1)
Attributes
- Returns
-
a matcher that needs to eventually match, after a given number of retries and a sleep time
(aResult === expected).eventually(retries = 2, _ * 100.milliseconds)
- Inherited from:
- Matcher
Attributes
- Returns
-
a matcher that needs to eventually match, after a given number of retries and a sleep time
- Inherited from:
- Matcher
Attributes
- Returns
-
a matcher that needs to eventually match, after 40 retries and a sleep time of 100 milliseconds
- Inherited from:
- Matcher
when the condition is true the matcher is applied, when it's false, the matcher must fail
when the condition is true the matcher is applied, when it's false, the matcher must fail
Attributes
- Inherited from:
- Matcher
The lazily
operator returns a Matcher which will match a function returning the expected value
The lazily
operator returns a Matcher which will match a function returning the expected value
Attributes
- Inherited from:
- Matcher
the logical or between 2 matchers
Attributes
- Returns
-
a Pending Result if this matcher fails, modifying the failure message with a pending message.
- Inherited from:
- Matcher
Attributes
- Returns
-
a Pending Result if this matcher fails, prefixing the failure message with a pending message. If the pending message is empty, only the failure message is printed
- Inherited from:
- Matcher
Attributes
- Returns
-
a Pending Result if this matcher fails
- Inherited from:
- Matcher
Attributes
- Returns
-
a Skipped Result if this matcher fails, modifying the failure message with a skip message.
- Inherited from:
- Matcher
Attributes
- Returns
-
a Skipped Result if this matcher fails, prefixing the failure message with a skip message. If the skip message is empty, only the failure message is printed
- Inherited from:
- Matcher
Attributes
- Returns
-
a Skipped result if this matcher fails
- Inherited from:
- Matcher
throw a FailureException if this matcher fails, modifying the failure message with a message.
throw a FailureException if this matcher fails, modifying the failure message with a message.
Attributes
- Inherited from:
- Matcher
throw a FailureException if this matcher fails prefixing the failure message with a message. If the message is empty, only the failure message is printed
throw a FailureException if this matcher fails prefixing the failure message with a message. If the message is empty, only the failure message is printed
Attributes
- Inherited from:
- Matcher
throw a FailureException if this matcher fails
Attributes
- Returns
-
set a new failure message of a matcher
- Inherited from:
- Matcher
Attributes
- Returns
-
a test function corresponding to this matcher
- Inherited from:
- Matcher
only apply this matcher if the condition is false
Attributes
- Returns
-
update the failure message of a matcher
- Inherited from:
- Matcher