groovy - How to use IgnoreIf in Spock, when I check the variable? -
i need skip functions in program, should depend on variable defined in same program. how can it?
def skip = true @ignoreif({ skip }) def "some function" () { .. }
another way using spock's configuration file include/exclude tests or base classes.
first create own annotations , place on tests.
write spock configuration file.
when run tests can set spock.configuration
property configuration file of choice.
way can include/exclude tests , base classes want.
example of spock configuration file:
runner { println "run tests" exclude enva }
your test:
@enva def "some function" () { .. }
you can run :
./gradlew test -pspock.configuration=myspockconfig.groovy
here github example
Comments
Post a Comment