Package spock.lang
Annotation Type IgnoreIf
-
@Retention(RUNTIME) @Target({TYPE,METHOD}) @Repeatable(Container.class) public @interface IgnoreIf
Ignores the annotated spec, feature or selected iterations if the given condition holds. Same asRequires
except that the condition is inverted.The configured closure is called with a delegate of type
PreconditionContext
which provides access to system properties, environment variables, the type of operating system and JVM.If applied to a data driven feature, the closure can also access the data variables. If the closure does not reference any actual data variables or is applied to a spec, the whole annotated element is skipped up-front, no fixtures, data providers or anything else will be executed. But if the closure actually does reference valid data variables, the whole workflow is followed up to the feature method invocation, where then the closure is checked, and it is decided whether to abort the specific iteration or not.
- See Also:
Requires
,PreconditionContext
-
-
-
reason
String reason
The reason for ignoring this element.- Returns:
- the string to use for the skip message
- Default:
- ""
-
-