Spek Testing Framework


Qualified supports writing test fixtures for Kotlin using Spek.

Quick Start

Solution Code

fun add(a: Int, b: Int) = a + b

Test Fixture:

import org.jetbrains.spek.api.Spek
import org.jetbrains.spek.api.dsl.describe
import org.jetbrains.spek.api.dsl.it
import kotlin.test.assertEquals

class ExampleSpec : Spek({
  describe("add") {
    it("should return the sum") {
      assertEquals(2, add(1, 1))

Assertion Libraries

Following assertion libraries can be used:

Learn More

You can learn more on the Spek website.