Ignore a Spock test if running in Travis CI

Thanks to Spock IgnoreIf annotation it is easy to ignore a specification running in Travis CI.

import spock.lang.IgnoreIf
import spock.lang.Specification

class ClassUnderTestSpec extends Specification {

    @IgnoreIf( { System.getenv('TRAVIS') as boolean } )
    def "test which fials if run by Travis CI"() {

Do you like to read about Grails / Geb / Groovy development? If the answer is yes, subscribe to Groovy Calamari. A weekly curated email newsletter about the Groovy ecosystem. Curated by me 🎉

Leave a Reply

Your email address will not be published. Required fields are marked *