class SpockMissingAssertRule extends AbstractAstVisitorRule
Spock treats all expressions on the first level of a then or expect block as an implicit assertion. However, everything inside if/for/switch/... blocks is not an implicit assert, just a useless comparison (unless wrapped by a `with` or `verifyAll`). Ø This rule finds such expressions, where an explicit call to assert would be required. Please note that the rule might produce false positives, as it relies on method names to determine whether an expression has a boolean type or not.
Fields inherited from class | Fields |
---|---|
class AbstractAstVisitorRule |
CLOSURE_TEXT, DEFAULT_CONST_NAME, DEFAULT_FIELD_NAME, DEFAULT_TEST_CLASS_NAMES, DEFAULT_TEST_FILES, DEFAULT_VAR_NAME |
Type | Name and description |
---|---|
java.lang.Class |
astVisitorClass |
java.lang.String |
name |
int |
priority |
java.lang.String |
specificationClassNames |
java.lang.String |
specificationSuperclassNames |
Constructor and description |
---|
SpockMissingAssertRule
() |
Groovy Documentation