{"id":35013014,"url":"https://github.com/pshevche/spockk","last_synced_at":"2026-04-02T10:35:52.838Z","repository":{"id":305516491,"uuid":"980593230","full_name":"pshevche/spockk","owner":"pshevche","description":"Add-on for the Spock testing framework bringing its expressive syntax to Kotlin","archived":false,"fork":false,"pushed_at":"2025-12-19T10:07:17.000Z","size":1056,"stargazers_count":8,"open_issues_count":12,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-20T08:03:18.721Z","etag":null,"topics":["kotlin","spock-framework","testing"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pshevche.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-09T11:38:10.000Z","updated_at":"2025-12-19T10:07:21.000Z","dependencies_parsed_at":"2025-09-20T19:05:50.884Z","dependency_job_id":null,"html_url":"https://github.com/pshevche/spockk","commit_stats":null,"previous_names":["pshevche/spokk","pshevche/spockk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pshevche/spockk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pshevche%2Fspockk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pshevche%2Fspockk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pshevche%2Fspockk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pshevche%2Fspockk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pshevche","download_url":"https://codeload.github.com/pshevche/spockk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pshevche%2Fspockk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28072696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kotlin","spock-framework","testing"],"created_at":"2025-12-27T05:03:49.346Z","updated_at":"2026-01-29T22:04:23.368Z","avatar_url":"https://github.com/pshevche.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\n  \u003cpicture width=\"200\"\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/pshevche/spockk/refs/heads/main/spockk-docs/docs/images/name_with_icon_dark.svg\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/pshevche/spockk/refs/heads/main/spockk-docs/docs/images/name_with_icon_light.svg\"\u003e\n    \u003cimg alt=\"Spockk\" src=\"https://raw.githubusercontent.com/pshevche/spockk/refs/heads/main/spockk-docs/docs/images/name_with_icon_light.svg\" width=\"200\"\u003e\n  \u003c/picture\u003e\n\u003c/h1\u003e\n\nThis repository is home to Spockk, an add-on for the [Spock](https://github.com/spockframework/spock) testing framework\nthat brings its expressive BDD-style syntax for Groovy to Kotlin.\n\n## Sneak peek\n\n```kotlin\nimport io.github.pshevche.spockk.lang.then\nimport io.github.pshevche.spockk.lang.`when`\nimport io.github.pshevche.spockk.lang.where\nimport spock.lang.Specification\nimport kotlin.test.assertEquals\n\nclass MathTest : Specification() {\n    fun `sum of two numbers`(a: Int, b: Int, expectedSum: Int) {\n        `when`\n        val sum = a + b\n\n        then\n        assertEquals(expectedSum, sum)\n\n        where\n        a ; b ; expectedSum\n        1 ; 3 ; 4\n        7 ; 4 ; 11\n        0 ; 0 ; 0\n    }\n}\n```\n\n## Getting started\n\n- [User guide](https://pshevche.github.io/spockk/)\n- [Example project](https://github.com/pshevche/spockk-example)\n\n## Development\n\n### High-level design\n\nThe Spock framework for Groovy relies on AST transformations to transform its expressive specification syntax into\nrunnable specification classes.\nThe Spockk add-on achieves a similar behavior by implementing a Kotlin compiler\nplugin ([examples](https://kotlinlang.org/docs/all-open-plugin.html#0)).\nThe following diagram shows the simplified interaction between all the different components that Spockk is composed of.\n\n```mermaid\ngraph TB\n    gradle[\"spockk-gradle-plugin\"]\n    intellij[\"spockk-intellij-plugin\"]\n    spock[\"spock-core\"]\n\n    subgraph compiler[\"Kotlin Compiler\"]\n        sources[\"Sources (.kt)\"]\n        frontend[\"Compiler frontend\"]\n        backend[\"JVM IR backend\"]\n        plugin[\"spockk-compiler-plugin\"]\n        bytecode[\"Bytecode\"]\n\n        sources --\u003e frontend\n        frontend --\u003e|generate intermediate representation| backend\n        backend --\u003e plugin\n        plugin --\u003e|transform IR into executable tests| bytecode\n    end\n\n    gradle --\u003e|applies spockk-compiler-plugin| compiler\n    intellij --\u003e|detects specifications and features| sources\n    spock --\u003e|executes| bytecode\n```\n\n### Modules\n\n- [`spockk-compiler-plugin`](spockk-compiler-plugin/README.adoc): implements IR transformations that modify the\n  simplified test syntax into tests compatible with Spock's test engine.\n- [`spockk-core`](spockk-core/README.adoc): declares additional Kotlin-specific specification syntax.\n- [`spockk-docs`](spockk-docs/README.adoc): module with user guide.\n- [`spockk-gradle-plugin`](spockk-gradle-plugin/README.adoc): Gradle plugin that abstracts away the application of the\n  `spockk-compiler-plugin` to Kotlin compiler invocations.\n- [`spockk-intellij-plugin`](spockk-intellij-plugin/README.adoc): provides support for Spockk tests in IntelliJ.\n- [`spockk-specs`](spockk-specs/README.adoc): specifications for the framework written with Spockk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpshevche%2Fspockk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpshevche%2Fspockk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpshevche%2Fspockk/lists"}