Thrown expectations will throw a FailureException if a match fails
This trait can be extended to be used in another framework like ScalaTest:
trait ScalaTestExpectations extends ThrownExpectations { override protected def checkFailure[T](m: =>MatchResult[T]) = { m match { case f @ MatchFailure(ok, ko, _, _, _) => throw new TestFailedException(f.message, f.exception, 0) case _ => () } m } }
- Companion:
- object
Value members
Inherited methods
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
- Inherited from:
- ExpectationsCreation
this method can be overriden to throw exceptions when checking the match result
this method can be overriden to throw exceptions when checking the match result
- Definition Classes
- Inherited from:
- ThrownExpectables
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
- Inherited from:
- ExpectationsCreation
- Returns:
the value without any side-effects for expectations
- Definition Classes
- Inherited from:
- ThrownStandardMatchResults
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