Http4sSuite

org.http4s.Http4sSuite

Common stack for http4s' munit based tests

Attributes

Source:
Http4sSuite.scala
Graph
Supertypes
trait ScalaCheckSuite
class FunSuite
trait BaseFunSuite
trait ValueTransforms
trait SuiteTransforms
trait TestTransforms
trait TestOptionsConversions
trait FunFixtures
trait Assertions
trait CompileErrorMacro
class Suite
trait PlatformSuite
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Classlikes

implicit class ParseResultSyntax[A](self: ParseResult[A])

Attributes

Source:
Http4sSuite.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Inherited classlikes

class FunFixture[T]

Attributes

Inherited from:
FunFixtures
Source:
FunFixtures.scala
Graph
Supertypes
class Object
trait Matchable
class Any
object FunFixture

Attributes

Inherited from:
FunFixtures
Source:
FunFixtures.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
Graph
Supertypes
class Object
trait Matchable
class Any
implicit class MUnitCatsAssertionsForIOOps[A](io: IO[A])

Attributes

Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectAssertions
Source:
CatsEffectAssertions.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectFunFixtures
Source:
CatsEffectFunFixtures.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectFixtures
Source:
CatsEffectFixtures.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectFixtures
Source:
CatsEffectFixtures.scala
Graph
Supertypes
class Object
trait Matchable
class Any
final class SuiteTransform(val name: String, fn: List[Test] => List[Test]) extends List[Test] => List[Test]

Attributes

Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala
Graph
Supertypes
trait List[Test] => List[Test]
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectFunFixtures
Source:
CatsEffectFunFixtures.scala
Graph
Supertypes
class Object
trait Matchable
class Any
final class TestTransform(val name: String, fn: Test => Test) extends Test => Test

Attributes

Inherited from:
TestTransforms
Source:
TestTransforms.scala
Graph
Supertypes
trait Test => Test
class Object
trait Matchable
class Any
final class ValueTransform(val name: String, fn: PartialFunction[Any, Future[Any]]) extends Any => Option[Future[Any]]

Attributes

Inherited from:
ValueTransforms
Source:
ValueTransforms.scala
Graph
Supertypes
trait Any => Option[Future[Any]]
class Object
trait Matchable
class Any

Deprecated and Inherited classlikes

Attributes

Deprecated
true
Inherited from:
CatsEffectFunFixtures
Source:
CatsEffectFunFixtures.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Deprecated
true
Inherited from:
CatsEffectFixtures
Source:
CatsEffectFixtures.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Inherited types

final type AfterEach = AfterEach

Attributes

Inherited from:
Suite
Source:
Suite.scala
final type BeforeEach = BeforeEach

Attributes

Inherited from:
Suite
Source:
Suite.scala
final type Fixture[T] = Fixture[T]

Attributes

Inherited from:
Suite
Source:
Suite.scala
final type Test = Test

Attributes

Inherited from:
Suite
Source:
Suite.scala
final type TestValue = Future[Any]

The value produced by test bodies.

The value produced by test bodies.

Attributes

Inherited from:
Suite
Source:
Suite.scala

Value members

Concrete methods

override def munitFixtures: Seq[IOFixture[_]]

Fixtures that can be reused for individual test cases or entire suites.

Fixtures that can be reused for individual test cases or entire suites.

Attributes

Definition Classes
Suite
Source:
Http4sSuite.scala
def registerSuiteFixture[A](fixture: IOFixture[A]): IOFixture[A]

Attributes

Source:
Http4sSuite.scala
def resourceSuiteFixture[A](name: String, resource: Resource[IO, A]): IOFixture[A]

Attributes

Source:
Http4sSuite.scala
def writeToString[A](a: A)(implicit W: EntityEncoder[IO, A]): IO[String]

Attributes

Source:
Http4sSuite.scala

Inherited methods

def afterAll(): Unit

Runs once after all test cases and after all suite-local fixtures have been tear down.

Runs once after all test cases and after all suite-local fixtures have been tear down.

Attributes

Inherited from:
Suite
Source:
Suite.scala
def afterEach(context: AfterEach): Unit

Runs after each individual test case.

Runs after each individual test case.

Attributes

Inherited from:
Suite
Source:
Suite.scala
def assert(cond: => Boolean, clue: => Any)(implicit loc: Location): Unit

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

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

Attributes

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.

Attributes

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.

Attributes

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

Attributes

Inherited from:
Assertions
Source:
Assertions.scala

Runs once before all test cases and before all suite-local fixtures are setup. An error in this method aborts the test suite.

Runs once before all test cases and before all suite-local fixtures are setup. An error in this method aborts the test suite.

Attributes

Inherited from:
Suite
Source:
Suite.scala
def beforeEach(context: BeforeEach): Unit

Runs before each individual test case. An error in this method aborts the test case.

Runs before each individual test case. An error in this method aborts the test case.

Attributes

Inherited from:
Suite
Source:
Suite.scala
def checkAll(options: TestOptions, ruleSet: RuleSet)(implicit loc: Location): Unit

Attributes

Inherited from:
DisciplineSuite
Source:
DisciplineSuite.scala
def checkAll(name: String, ruleSet: RuleSet)(implicit loc: Location): Unit

Attributes

Inherited from:
DisciplineSuite
Source:
DisciplineSuite.scala
def clue[T](c: Clue[T]): T

Attributes

Inherited from:
Assertions
Source:
Assertions.scala
def clues(clue: Clue[_]*): Clues

Attributes

Inherited from:
Assertions
Source:
Assertions.scala
inline def compileErrors(inline code: String): String

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

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

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.

Attributes

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.

Attributes

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

Attributes

Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala

Attributes

Inherited from:
Assertions
Source:
Assertions.scala
def munitCaptureClues[T](thunk: => T): (T, Clues)

Attributes

Inherited from:
Assertions
Source:
Assertions.scala

Attributes

Inherited from:
TestTransforms
Source:
TestTransforms.scala
override def munitFlakyOK: Boolean

Attributes

Definition Classes
Inherited from:
Http4sSuitePlatform
Source:
Http4sSuitePlatform.scala

Attributes

Inherited from:
TestTransforms
Source:
TestTransforms.scala

Attributes

Inherited from:
ValueTransforms
Source:
ValueTransforms.scala

The timeout for IO-based tests. When it expires it will gracefully cancel the fiber running the test and invoke any finalizers before ultimately failing the test.

The timeout for IO-based tests. When it expires it will gracefully cancel the fiber running the test and invoke any finalizers before ultimately failing the test.

Note that the fiber may still hang while running finalizers or even be uncancelable. In this case the munitTimeout will take effect, with the caveat that the hanging fiber will be leaked.

Attributes

Inherited from:
CatsEffectSuite
Source:
CatsEffectSuite.scala

Attributes

Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala

Attributes

Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala

Attributes

Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala
def munitPrint(clue: => Any): String

Attributes

Inherited from:
Assertions
Source:
Assertions.scala
final def munitSuiteTransform(tests: List[Test]): List[Test]

Attributes

Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala

Attributes

Inherited from:
SuiteTransforms
Source:
SuiteTransforms.scala
final def munitTestTransform(test: Test): Test

Attributes

Inherited from:
TestTransforms
Source:
TestTransforms.scala

Attributes

Definition Classes
ScalaCheckSuite -> TestTransforms
Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala
def munitTests(): Seq[Test]

The base class for all test suites

The base class for all test suites

Attributes

Inherited from:
BaseFunSuite
Source:
FunSuite.scala
override def munitTimeout: Duration

The overall timeout applicable to all tests in the suite, including those written in terms of Future or synchronous code. This is implemented by the MUnit framework itself.

The overall timeout applicable to all tests in the suite, including those written in terms of Future or synchronous code. This is implemented by the MUnit framework itself.

When this timeout expires, the suite will immediately fail the test and proceed without waiting for its cancelation or even attempting to cancel it. For that reason it is recommended to set this to a greater value than munitIOTimeout, which performs graceful cancelation of IO-based tests. The default grace period for cancelation is 1 second.

Attributes

Definition Classes
CatsEffectSuite -> BaseFunSuite
Inherited from:
CatsEffectSuite
Source:
CatsEffectSuite.scala
final def munitValueTransform(testValue: => Any): Future[Any]

Attributes

Inherited from:
ValueTransforms
Source:
ValueTransforms.scala
def property(options: TestOptions)(body: => Prop)(implicit loc: Location): Unit

Attributes

Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala
def property(name: String)(body: => Prop)(implicit loc: Location): Unit

Attributes

Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala

Attributes

Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala

Attributes

Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala

Attributes

Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala
def test(options: TestOptions)(body: => Any)(implicit loc: Location): Unit

Attributes

Inherited from:
BaseFunSuite
Source:
FunSuite.scala
def test(name: String)(body: => Any)(implicit loc: Location): Unit

Attributes

Inherited from:
BaseFunSuite
Source:
FunSuite.scala

Deprecated and Inherited methods

Attributes

Deprecated
true
Inherited from:
CatsEffectSuite
Source:
CatsEffectSuite.scala

Inherited fields

val munitLines: Lines

Attributes

Inherited from:
Assertions
Source:
Assertions.scala
final val munitTestsBuffer: ListBuffer[Test]

Attributes

Inherited from:
BaseFunSuite
Source:
FunSuite.scala

Implicits

Implicits

final implicit def ParseResultSyntax[A](self: ParseResult[A]): ParseResultSyntax[A]

Attributes

Source:
Http4sSuite.scala

Inherited implicits

Attributes

Definition Classes
Inherited from:
CatsEffectSuite
Source:
CatsEffectSuite.scala

Attributes

Inherited from:
CatsEffectSuite
Source:
CatsEffectSuite.scala
implicit def testOptionsFromString(name: String)(implicit loc: Location): TestOptions

Implicitly create a TestOptions given a test name. This allows writing test("name") { ... } even if test accepts a TestOptions

Implicitly create a TestOptions given a test name. This allows writing test("name") { ... } even if test accepts a TestOptions

Attributes

Inherited from:
TestOptionsConversions
Source:
TestOptions.scala
implicit def unitToProp(unit: Unit): Prop

Attributes

Inherited from:
ScalaCheckSuite
Source:
ScalaCheckSuite.scala