Package strikt.api

Class Summary

Methods

fun expect(block: suspend ExpectationBuilder.()->Unit)

Starts a block of assertions that will all be evaluated regardless of whether earlier ones fail. This is the entry-point for the assertion API.

Parameters:
fun <T> expectThat(subject: T): DescribeableBuilder

Start a chain of assertions over subject. This is the entry-point for the assertion API.

Parameters:
  • subject: T

    the subject of the chain of assertions.

fun <T> expectThat(subject: T, block: Builder.()->Unit): DescribeableBuilder

Evaluate a block of assertions over subject. This is the entry-point for the assertion API.

Parameters:
  • subject: T

    the subject of the block of assertions.

  • block: Builder.()->Unit

    a closure that can perform multiple assertions that will all be evaluated regardless of whether preceding ones pass or fail.

inline fun <E : Throwable> expectThrows(action: suspend ()->Any?): Builder

Asserts that actionthrows an exception of type E when executed.

Parameters:
  • action: suspend ()->Any?
fun <T> expectCatching(action: suspend ()->T): DescribeableBuilder

Start a chain of assertions over the result of action which may either be the value action returns or any exception it throws. This is the entry-point for the assertion API.

Parameters:
  • action: suspend ()->T