MUnitCatsAssertionsForSyncIOOps
class Object
trait Matchable
class Any
Value members
Concrete methods
Asserts that this effect returns an expected value.
Asserts that this effect returns an expected value.
The "expected" value (second argument) must have the same type or be a subtype of the one "contained" inside the effect. For example:
SyncIO(Option(1)).assertEquals(Some(1)) // OK
SyncIO(Some(1)).assertEquals(Option(1)) // Error: Option[Int] is not a subtype of Some[Int]
The "clue" value can be used to give extra information about the failure in case the assertion fails.
- Value Params
- clue
a value that will be printed in case the assertions fails
- expected
the expected value
Intercepts a Throwable
being thrown inside this effect.
Intercepts a Throwable
being thrown inside this effect.
- Example
val io = SyncIO.raiseError[Unit](MyException("BOOM!")) io.intercept[MyException]
def interceptMessage[T <: Throwable](expectedExceptionMessage: String)(implicit T: ClassTag[T], loc: Location): SyncIO[T]
Intercepts a Throwable
with a certain message being thrown inside this effect.
Intercepts a Throwable
with a certain message being thrown inside this effect.
- Example
val io = SyncIO.raiseError[Unit](MyException("BOOM!")) io.intercept[MyException]("BOOM!")