Spockk is a compiler plugin that brings Spock's expressive given/when/then specification syntax natively into Kotlin: no Groovy, no string DSLs, just real Kotlin code that compiles down to genuine Spock specifications.
class WelcomeSpec : Specification() {
fun `welcome to Spockk`(visitor: Being, greeting: String) {
given
val spock = Vulcan("Spock")
expect
spock.greet(visitor) == greeting
where
visitor ; greeting
Vulcan("Sarek") ; "Live long and prosper!"
Human("Kirk") ; "Hello!"
}
}Spock is one of the most expressive testing frameworks around, but it's written for Groovy, and speaks with a Groovy accent: dynamic typing, closures-as-blocks, and an AST transform that rewrites your test class before Kotlin ever gets a say.
Spockk adds Kotlin dialect for Spock. It's a Kotlin compiler plugin that recognizes Spock's block-label vocabulary (given, when, then, expect, and, where, cleanup), written as plain, statically-typed Kotlin, and rewrites it at compile time into genuine Spock feature methods. The result runs on Spock's own JUnit Platform engine, right alongside your Groovy specs.
Groovy syntax you are used to as real Kotlin declarations, type-checked by the compiler.
Your specs compile down to genuine Spock features, so you keep Spock's runtime behavior.
Runs on Spock's JUnit Platform engine, so it works with the tools you already use for Kotlin.