Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Failed to load latest commit information.
grails-app/conf
src/java/es/osoco/grails/plugins
test/integration/es/osoco/grails/plugins Documentation link fixed
.gitignore Documentation link fixed
LICENSE Documentation link fixed
README.md Extension shortened
SpockGrailsEnvExtensionsGrailsPlugin.groovy Explicit Spock dependency removed
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.