Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 grails-app
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 SpockGrailsEnvExtensionsGrailsPlugin.groovy
Octocat-spinner-32 application.properties
README.md

Introduction

This plugin provides Spock extensions that allow specification and feature method inclusion and exclusion depending on the Grails execution environment.

Usage

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

Something went wrong with that request. Please try again.