{"id":22326502,"url":"https://github.com/thecodesmith/spock-override-extension","last_synced_at":"2026-06-15T20:31:45.257Z","repository":{"id":84776817,"uuid":"144637574","full_name":"thecodesmith/spock-override-extension","owner":"thecodesmith","description":"Override or ignore inherited Spock feature methods","archived":false,"fork":false,"pushed_at":"2018-08-16T17:37:27.000Z","size":71,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-10T22:39:25.325Z","etag":null,"topics":["groovy","java","spock-framework"],"latest_commit_sha":null,"homepage":null,"language":"Groovy","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/thecodesmith.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}},"created_at":"2018-08-13T21:52:33.000Z","updated_at":"2019-01-30T11:40:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"1cc685c8-8946-45ec-969b-f0596a6b2695","html_url":"https://github.com/thecodesmith/spock-override-extension","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/thecodesmith/spock-override-extension","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodesmith%2Fspock-override-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodesmith%2Fspock-override-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodesmith%2Fspock-override-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodesmith%2Fspock-override-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodesmith","download_url":"https://codeload.github.com/thecodesmith/spock-override-extension/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodesmith%2Fspock-override-extension/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34379915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"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":["groovy","java","spock-framework"],"created_at":"2024-12-04T02:17:56.688Z","updated_at":"2026-06-15T20:31:45.242Z","avatar_url":"https://github.com/thecodesmith.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spock Override Extension\n\n_This extension enables selective override or ignore of inherited Spock features_\n\n[![Download](https://api.bintray.com/packages/thecodesmith/maven/spock-override-extension/images/download.svg)](https://bintray.com/thecodesmith/maven/spock-override-extension/_latestVersion)\n[![Build Status](https://travis-ci.org/thecodesmith/spock-override-extension.svg?branch=master)](https://travis-ci.org/thecodesmith/spock-override-extension)\n[![Coveralls Coverage Status](https://coveralls.io/repos/github/thecodesmith/spock-override-extension/badge.svg?branch=master)](https://coveralls.io/github/thecodesmith/spock-override-extension?branch=master)\n\n## Get Started\n\nTo use this extension, just add it as a test dependency and use the provided\nannotations.\n\nAdd the library to your `build.gradle` dependencies:\n\n    testCompile 'com.thecodesmith.spock:spock-override-extension:1.0.3'\n\nThese annotations will be available:\n\n- `@IgnoreSuperSpecFeatures` - This class-level annotation takes an array of\n  method names (features) from the parent class to ignore\n- `@OverrideSuperSpec` - This method-level annotation overrides the parent\n  feature method of the same method name\n\n## Use Case\n\nSometimes when using [Spock](http://spockframework.org) you need to inherit\nfeature methods from another `Specification` class, but need to override or\nignore a few. This library provides the override/ignore capability through\nSpock's extension mechanism.\n\nBelow is an example. Note that this also works with non-abstract base classes.\n\n```groovy\nabstract class BaseSpec extends Specification {\n\n    @Shared String thing\n\n    def 'base feature'() {\n        expect: thing != null\n    }\n\n    def 'override me'() {\n        expect: false\n    }\n\n    def 'ignore me'() {\n        expect: false\n    }\n}\n```\n\n```groovy\n@IgnoreSuperSpecFeatures(['ignore me'])\nclass DerivedSpec extends BaseSpec {\n\n    def setupSpec() {\n        thing = 'foo'\n    }\n\n    def 'derived feature'() {\n        expect: true\n    }\n\n    @OverrideSuperSpec\n    def 'override me'() {\n        expect: true\n    }\n}\n```\n\nRunning `DerivedSpec` results in a green build:\n```\n√ (passed)  base feature\n√ (passed)  derived feature\n√ (passed)  override me\no (ignored) ignore me\nTests passed: 3, ignored: 1 of 4 tests\n```\n\nSee [UsageSpec.groovy](src/test/groovy/com/thecodesmith/spock/extensions/UsageSpec.groovy)\nfor more examples.\n\n## Disclaimer\n\nMost of the time there are better ways to structure tests than using\ninheritance, and this mechanism isn't necessary. The specific use case behind\nthis extension was the need to run common tests across many modules in a\nmulti-module project. Structuring the tests in this way allows the common tests\nto be included as a dependency in other modules, and customized as needed to\nfit the needs to the module. So, think twice before using this extension, but\nif you need it, you need it!\n\n## Contributing\n\nPull requests are welcome! If you see a missing feature, create a pull request\nand I will work to get it merged into the project.  Reporting issues is a big\nhelp as well.\n\n## License\n\nThis library is licensed under the terms of the [Apache License, Version\n2.0](http://www.apache.org/licenses/LICENSE-2.0.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodesmith%2Fspock-override-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodesmith%2Fspock-override-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodesmith%2Fspock-override-extension/lists"}