CatsEffectSuite

abstract class CatsEffectSuite extends FunSuite with CatsEffectAssertions with CatsEffectFunFixtures
class FunSuite
trait ValueTransforms
trait SuiteTransforms
trait TestTransforms
trait TestOptionsConversions
trait FunFixtures
trait Assertions
trait CompileErrorMacro
class Suite
trait PlatformSuite
class Object
trait Matchable
class Any

Type members

Inherited classlikes

class FunFixture[T]
Inhertied from
FunFixtures
class MUnitCatsAssertionsForSyncIOOps[A](io: SyncIO[A])
Inhertied from
CatsEffectAssertions
abstract class Fixture[T](val fixtureName: String)
Value Params
name
The name of this fixture, used for displaying an error message if
beforeAll() or afterAll() fail.
Inhertied from
Suite
final class ValueTransform(val name: String, fn: PartialFunction[Any, Future[Any]])
Inhertied from
ValueTransforms
final class TestTransform(val name: String, fn: Test => Test)
Inhertied from
TestTransforms
class SyncIOFunFixtureOps[T](fixture: SyncIO[FunFixture[T]])
Inhertied from
CatsEffectFunFixtures
final class SuiteTransform(val name: String, fn: List[Test] => List[Test])
Inhertied from
SuiteTransforms
class MUnitCatsAssertionsForIOBooleanOps(io: IO[Boolean])
Inhertied from
CatsEffectAssertions
object FunFixture
Inhertied from
FunFixtures
class MUnitCatsAssertionsForIOOps[A](io: IO[A])
Inhertied from
CatsEffectAssertions

Inherited types

final type Test = GenericTest[TestValue]
Inhertied from
Suite
final type BeforeEach = GenericBeforeEach[TestValue]
Inhertied from
Suite
final type TestValue = Future[Any]
Inhertied from
FunSuite
final type AfterEach = GenericAfterEach[TestValue]
Inhertied from
Suite

Value members

Methods

override def munitValueTransforms: List[ValueTransform]
Definition Classes
ValueTransforms

Inherited methods

final def munitOnlySuiteTransform: SuiteTransform
Inhertied from
SuiteTransforms
def munitPrint(clue: => Any): String
Inhertied from
Assertions
def failComparison(message: String, obtained: Any, expected: Any, clues: Clues)(loc: Location): Nothing
Inhertied from
Assertions
def beforeEach(context: BeforeEach): Unit
Runs before each individual test case.
An error in this method aborts the test case.
Inhertied from
Suite
def munitTestTransforms: List[TestTransform]
Inhertied from
TestTransforms
def interceptIO[T <: Throwable](io: IO[Any])(T: ClassTag[T], loc: Location): IO[T]
Intercepts a Throwable being thrown inside the provided IO.
Example
{{{
val io = IO.raiseErrorUnit
interceptIOMyException
}}}
or
{{{
interceptIO[MyException] {
IO.raiseErrorUnit
}
}}}
Inhertied from
CatsEffectAssertions
def interceptMessageSyncIO[T <: Throwable](expectedExceptionMessage: String)(io: SyncIO[Any])(T: ClassTag[T], loc: Location): SyncIO[T]
Intercepts a Throwable with a certain message being thrown inside the provided SyncIO.
Example
{{{
val io = SyncIO.raiseErrorUnit
interceptSyncIOMyException(io)
}}}
or
{{{
interceptSyncIO[MyException] {
SyncIO.raiseErrorUnit
}
}}}
Inhertied from
CatsEffectAssertions
final def munitFlakyTransform: TestTransform
Inhertied from
TestTransforms
def isCI: Boolean
Inhertied from
SuiteTransforms
def afterEach(context: AfterEach): Unit
Runs after each individual test case.
Inhertied from
Suite
def munitAnsiColors: Boolean
Inhertied from
Assertions
final def munitSuiteTransform(tests: List[Test]): List[Test]
Inhertied from
SuiteTransforms
def beforeAll(): Unit
Runs once before all test cases and before all suite-local fixtures are setup.
An error in this method aborts the test suite.
Inhertied from
Suite
inline def compileErrors(inline code: String): String
Inhertied from
CompileErrorMacro
def munitCaptureClues[T](thunk: => T): (T, Clues)
Inhertied from
Assertions
def interceptMessageIO[T <: Throwable](expectedExceptionMessage: String)(io: IO[Any])(T: ClassTag[T], loc: Location): IO[T]
Intercepts a Throwable with a certain message being thrown inside the provided IO.
Example
{{{
val io = IO.raiseErrorUnit
interceptIOMyException(io)
}}}
or
{{{
interceptIO[MyException] {
IO.raiseErrorUnit
}
}}}
Inhertied from
CatsEffectAssertions
def assume(cond: Boolean, clue: => Any)(loc: Location): Unit
Inhertied from
Assertions
def munitIgnore: Boolean
Inhertied from
SuiteTransforms
def intercept[T <: Throwable](body: => Any)(T: ClassTag[T], loc: Location): T
Inhertied from
Assertions
def failSuite(message: String, clues: Clues)(loc: Location): Nothing
Inhertied from
Assertions
def test(options: TestOptions)(body: => Any)(loc: Location): Unit
Inhertied from
FunSuite
def test(name: String)(body: => Any)(loc: Location): Unit
Inhertied from
FunSuite
def interceptMessage[T <: Throwable](expectedExceptionMessage: String)(body: => Any)(T: ClassTag[T], loc: Location): T
Inhertied from
Assertions
def assertNotEquals[A, B](obtained: A, expected: B, clue: => Any)(loc: Location, ev: A =:= B): Unit
Inhertied from
Assertions
final def munitIgnoreSuiteTransform: SuiteTransform
Inhertied from
SuiteTransforms
def assertEqualsDouble(obtained: Double, expected: Double, delta: Double, clue: => Any)(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.
Inhertied from
Assertions
final def munitFailTransform: TestTransform
Inhertied from
TestTransforms
final def munitTestTransform(test: Test): Test
Inhertied from
TestTransforms
def clue[T](c: Clue[T]): T
Inhertied from
Assertions
def fail(message: String, clues: Clues)(loc: Location): Nothing
Inhertied from
Assertions
def fail(message: String, cause: Throwable)(loc: Location): Nothing
Inhertied from
Assertions
def munitTimeout: Duration
Inhertied from
FunSuite
final def munitValueTransform(testValue: => Any): Future[Any]
Inhertied from
ValueTransforms
def clues(clue: Clue[]*): Clues
Inhertied from
Assertions
def munitSuiteTransforms: List[SuiteTransform]
Inhertied from
SuiteTransforms
def munitExecutionContext: ExecutionContext
Inhertied from
Suite
def afterAll(): Unit
Runs once after all test cases and after all suite-local fixtures have been tear down.
Inhertied from
Suite
def assertEqualsFloat(obtained: Float, expected: Float, delta: Float, clue: => Any)(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.
Inhertied from
Assertions
def munitFixtures: Seq[Fixture[]]
Functinonal fixtures that can be reused for individual test cases or entire suites.
Inhertied from
Suite
def assertNoDiff(obtained: String, expected: String, clue: => Any)(loc: Location): Unit
Inhertied from
Assertions
def assert(cond: => Boolean, clue: => Any)(loc: Location): Unit
Inhertied from
Assertions
def assertSyncIO[A, B](obtained: SyncIO[A], returns: B, clue: => Any)(loc: Location, ev: B <:< A): SyncIO[Unit]
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 Params
clue
a value that will be printed in case the assertions fails
obtained
the SyncIO under testing
returns
the expected value
Inhertied from
CatsEffectAssertions
def assertIO[A, B](obtained: IO[A], returns: B, clue: => Any)(loc: Location, ev: B <:< A): IO[Unit]
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 Params
clue
a value that will be printed in case the assertions fails
obtained
the IO under testing
returns
the expected value
Inhertied from
CatsEffectAssertions
def interceptSyncIO[T <: Throwable](io: SyncIO[Any])(T: ClassTag[T], loc: Location): SyncIO[T]
Intercepts a Throwable being thrown inside the provided SyncIO.
Example
{{{
val io = SyncIO.raiseErrorUnit
interceptSyncIOMyException
}}}
or
{{{
interceptSyncIO[MyException] {
SyncIO.raiseErrorUnit
}
}}}
Inhertied from
CatsEffectAssertions
def munitFlakyOK: Boolean
Inhertied from
TestTransforms
def munitTests(): Seq[Test]
Inhertied from
FunSuite
final def munitFutureTransform: ValueTransform
Inhertied from
ValueTransforms
def assertEquals[A, B](obtained: A, expected: B, clue: => Any)(loc: Location, ev: B <:< A): Unit
Asserts that two elements are equal using == equality.
The "expected" value (second argument) must have the same type or be a
subtype of the "obtained" value (first argument). For example:
{{{
assertEquals(Option(1), Some(1)) // OK
assertEquals(Some(1), Option(1)) // Error: Option[Int] is not a subtype of Some[Int]
}}}
Use assertEquals[Any, Any](a, b) as an escape hatch to compare two
values of different types. For example:
{{{
val a: Either[List[String] , Int] = Right(42)
val b: Either[String, Int] = Right(42)
assertEquals[Any, Any] (a, b) // OK
assertEquals(a, b) // Error: Either[String, Int] is not a subtype of Either[List[String] , Int]
}}}
Inhertied from
Assertions

Inherited fields

final val munitTestsBuffer: ListBuffer[Test]
Inhertied from
FunSuite
val munitLines: Lines
Inhertied from
Assertions

Implicits

Implicits

implicit def munitContextShift: ContextShift[[A] =>> IO[A]]
implicit def munitTimer: Timer[[A] =>> IO[A]]

Inherited implicits

implicit def testOptionsFromString(name: String)(loc: Location): TestOptions
Implicitly create a TestOptions given a test name.
This allows writing test("name") { ... } even if test accepts a TestOptions
Inhertied from
TestOptionsConversions