org.specs2.matcher.ExceptionMatchers
See theExceptionMatchers companion object
These matchers can be used to check if exceptions are thrown or not
Attributes
Companion
object
Graph
Reset zoom Hide graph Show graph
Supertypes
class Object
trait Matchable
class Any
Show all
Known subtypes
Members list
An exception matcher checks if an expression throws some specified exceptions:
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
Supertypes
class Object
trait Matchable
class Any
Self type
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
Attributes
Attributes
Returns
a matcher checking the type of an Exception
Attributes
Returns
a matcher checking the type of an Exception and its message (as a regexp)
Attributes
Returns
a matcher checking the value of an Exception
this method can be overridden to throw exceptions when checking a result
this method can be overridden to throw exceptions when checking a result
Attributes
Inherited from:
ResultChecks
Attributes
Returns
an Expectable with a function to show the element T
Inherited from:
ExpectationsCreation
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
Attributes
Inherited from:
ResultChecks
Attributes
Returns
the result without any side-effects
Inherited from:
ResultChecks
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
Attributes
Inherited from:
MatchResultStackTrace