CatsEffectAssertions

object CatsEffectAssertions extends Assertions with CatsEffectAssertions
trait Assertions
trait CompileErrorMacro
class Object
trait Matchable
class Any

Value members

Inherited methods

def assert(cond: => Boolean, clue: => Any)(implicit loc: Location): Unit
Inherited from:
Assertions
Source:
Assertions.scala
def assertEquals[A, B](obtained: A, expected: B, clue: => Any)(implicit loc: Location, compare: Compare[A, B]): Unit

Asserts that two elements are equal according to the Compare[A, B] type-class.

Asserts that two elements are equal according to the Compare[A, B] type-class.

By default, uses == to compare values.

Inherited from:
Assertions
Source:
Assertions.scala
def assertEqualsDouble(obtained: Double, expected: Double, delta: Double, clue: => Any)(implicit loc: Location): Unit

Asserts that two doubles are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes.

Asserts that two doubles are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes.

Inherited from:
Assertions
Source:
Assertions.scala
def assertEqualsFloat(obtained: Float, expected: Float, delta: Float, clue: => Any)(implicit loc: Location): Unit

Asserts that two floats are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Float.NaN, Float.NaN, *) passes.

Asserts that two floats are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Float.NaN, Float.NaN, *) passes.

Inherited from:
Assertions
Source:
Assertions.scala
def assertIO[A, B](obtained: IO[A], returns: B, clue: => Any)(implicit loc: Location, ev: B <:< A): IO[Unit]

Asserts that an IO returns an expected value.

Asserts that an IO returns an expected value.

The "returns" value (second argument) must have the same type or be a subtype of the one "contained" inside the IO (first argument). For example:

 assertIO(IO(Option(1)), returns = Some(1)) // OK
 assertIO(IO(Some(1)), returns = 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 parameters:
clue

a value that will be printed in case the assertions fails

obtained

the IO under testing

returns

the expected value

Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
def assertNoDiff(obtained: String, expected: String, clue: => Any)(implicit loc: Location): Unit
Inherited from:
Assertions
Source:
Assertions.scala
def assertNotEquals[A, B](obtained: A, expected: B, clue: => Any)(implicit loc: Location, compare: Compare[A, B]): Unit

Asserts that two elements are not equal according to the Compare[A, B] type-class.

Asserts that two elements are not equal according to the Compare[A, B] type-class.

By default, uses == to compare values.

Inherited from:
Assertions
Source:
Assertions.scala
def assertSyncIO[A, B](obtained: SyncIO[A], returns: B, clue: => Any)(implicit loc: Location, ev: B <:< A): SyncIO[Unit]

Asserts that a SyncIO returns an expected value.

Asserts that a SyncIO returns an expected value.

The "returns" value (second argument) must have the same type or be a subtype of the one "contained" inside the SyncIO (first argument). For example:

 assertSyncIO(SyncIO(Option(1)), returns = Some(1)) // OK
 assertSyncIO(SyncIO(Some(1)), returns = 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 parameters:
clue

a value that will be printed in case the assertions fails

obtained

the SyncIO under testing

returns

the expected value

Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
def assume(cond: Boolean, clue: => Any)(implicit loc: Location): Unit
Inherited from:
Assertions
Source:
Assertions.scala
def clue[T](c: Clue[T]): T
Inherited from:
Assertions
Source:
Assertions.scala
def clues(clue: Clue[_]*): Clues
Inherited from:
Assertions
Source:
Assertions.scala
inline def compileErrors(inline code: String): String
Inherited from:
CompileErrorMacro
Source:
MacroCompat.scala
def fail(message: String, clues: Clues)(implicit loc: Location): Nothing

Unconditionally fails this test with the given message and optional clues.

Unconditionally fails this test with the given message and optional clues.

Inherited from:
Assertions
Source:
Assertions.scala
def fail(message: String, cause: Throwable)(implicit loc: Location): Nothing

Unconditionally fails this test with the given message and exception marked as the cause.

Unconditionally fails this test with the given message and exception marked as the cause.

Inherited from:
Assertions
Source:
Assertions.scala
def failComparison(message: String, obtained: Any, expected: Any, clues: Clues)(implicit loc: Location): Nothing

Unconditionally fails this test due to result of comparing two values.

Unconditionally fails this test due to result of comparing two values.

The only reason to use this method instead of fail() is if you want to allow comparing the two different values in the the IntelliJ GUI diff viewer.

Inherited from:
Assertions
Source:
Assertions.scala
def failSuite(message: String, clues: Clues)(implicit loc: Location): Nothing

Unconditionally fail this test case and cancel all the subsequent tests in this suite.

Unconditionally fail this test case and cancel all the subsequent tests in this suite.

Inherited from:
Assertions
Source:
Assertions.scala
def intercept[T <: Throwable](body: => Any)(implicit T: ClassTag[T], loc: Location): T

Evalutes the given expression and asserts that an exception of type T is thrown.

Evalutes the given expression and asserts that an exception of type T is thrown.

Inherited from:
Assertions
Source:
Assertions.scala
def interceptIO[T <: Throwable](io: IO[Any])(implicit T: ClassTag[T], loc: Location): IO[T]

Intercepts a Throwable being thrown inside the provided IO.

Intercepts a Throwable being thrown inside the provided IO.

Example:
 val io = IO.raiseError[Unit](MyException("BOOM!"))
 interceptIO[MyException](io)

or

 interceptIO[MyException] {
     IO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
def interceptMessage[T <: Throwable](expectedExceptionMessage: String)(body: => Any)(implicit T: ClassTag[T], loc: Location): T

Evalutes the given expression and asserts that an exception of type T with the expected message is thrown.

Evalutes the given expression and asserts that an exception of type T with the expected message is thrown.

Inherited from:
Assertions
Source:
Assertions.scala
def interceptMessageIO[T <: Throwable](expectedExceptionMessage: String)(io: IO[Any])(implicit T: ClassTag[T], loc: Location): IO[T]

Intercepts a Throwable with a certain message being thrown inside the provided IO.

Intercepts a Throwable with a certain message being thrown inside the provided IO.

Example:
 val io = IO.raiseError[Unit](MyException("BOOM!"))
 interceptIO[MyException]("BOOM!")(io)

or

 interceptIO[MyException] {
     IO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
def interceptMessageSyncIO[T <: Throwable](expectedExceptionMessage: String)(io: SyncIO[Any])(implicit T: ClassTag[T], loc: Location): SyncIO[T]

Intercepts a Throwable with a certain message being thrown inside the provided SyncIO.

Intercepts a Throwable with a certain message being thrown inside the provided SyncIO.

Example:
 val io = SyncIO.raiseError[Unit](MyException("BOOM!"))
 interceptSyncIO[MyException]("BOOM!")(io)

or

 interceptSyncIO[MyException] {
     SyncIO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
def interceptSyncIO[T <: Throwable](io: SyncIO[Any])(implicit T: ClassTag[T], loc: Location): SyncIO[T]

Intercepts a Throwable being thrown inside the provided SyncIO.

Intercepts a Throwable being thrown inside the provided SyncIO.

Example:
 val io = SyncIO.raiseError[Unit](MyException("BOOM!"))
 interceptSyncIO[MyException](io)

or

 interceptSyncIO[MyException] {
     SyncIO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
Inherited from:
Assertions
Source:
Assertions.scala
def munitCaptureClues[T](thunk: => T): (T, Clues)
Inherited from:
Assertions
Source:
Assertions.scala
def munitPrint(clue: => Any): String
Inherited from:
Assertions
Source:
Assertions.scala

Inherited fields

val munitLines: Lines
Inherited from:
Assertions
Source:
Assertions.scala