https://github.com/osoco/grails-spock-env-extensions
https://github.com/osoco/grails-spock-env-extensions
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/osoco/grails-spock-env-extensions
- Owner: osoco
- License: apache-2.0
- Created: 2011-07-20T06:33:30.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2013-10-11T12:27:55.000Z (over 12 years ago)
- Last Synced: 2025-03-05T17:34:39.731Z (over 1 year ago)
- Language: Groovy
- Homepage:
- Size: 121 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Introduction
This plugin provides [Spock](http://spockframework.org/) extensions that allow specification and feature method inclusion and exclusion depending on the Grails execution environment.
# Usage
```groovy
class SingleFeatureMethodsExecutedAndIgnoredSpec extends Specification {
@ExecuteForEnvironment(['test_integration', 'test_performance'])
def "executes a feature method only in the given environments"() {
// ...
}
@IgnoreForEnvironment(['test_integration', 'test_performance'])
def "ignores a feature method only in the given environments"() {
// ...
}
}
@ExecuteForEnvironment(['test_integration', 'test_performance'])
class TheWholeSpecExecutedSpec extends Specification {
// all feature methods will be executed only in the given environments
}
@IgnoreForEnvironment(['test_integration', 'test_performance'])
class TheWholeSpecIgnoredSpec extends Specification {
// all feature methods will be ignored only in the given environments
}
```
Note that you have to specify environment names as ```String``` and not as ```grails.utils.Environment``` constants. The reason is that we crafted these extensions for our custom environments that are simply described as strings.
# Contributors
* [Marcin Gryszko](http://github.com/mgryszko/)