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"() {
    }

Tags: #ci #travis #spock
Apr 2017, 27.

 

My next events:
🗓 Oct 05 17:00 Jumpstart your Java applications with AWS Lambda and Micronaut