-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no-pattern-restrictions rule #184
Conversation
- Make Scenario, ScenarioOutline and Background patterns apply to corresponding names and descriptions - Make all patterns case insensitive - Make sure rule doesn't break on an empty scenario - Add violated pattern to error message for more clarity (multiple patterns can produce multiple errors)
it('doesn\'t raise errors when there are no violations', function() { | ||
runTest('no-restricted-patterns/NoViolations.feature', { | ||
'Global': [ | ||
'^.*disallowed.*$' | ||
]}, []); | ||
}); | ||
|
||
it('detects errors for features, scenarios, backgrounds, and scenario outlines', function() { | ||
runTest('no-restricted-patterns/Violations.feature', { | ||
it('detects errors in Feature names and descriptions that match the Feature or Global config', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split up the tests, because the number of errors was becoming pretty big and the file was becoming unreadable.
Pull Request Test Coverage Report for Build 430
💛 - Coveralls |
…'t really share much code
5baf630
to
e4afbc1
Compare
function checkNameAndDescription(node, restrictedPatterns, errors) { | ||
restrictedPatterns[node.type] | ||
.forEach(function(pattern) { | ||
check(node, 'name', pattern, errors); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scenarios and ScenarioOutlines also have a name
Scenarios and ScenarioOutlines and Background also have a description
corresponding names and descriptions (consistency with Feature)
patterns can produce multiple errors)
@jhedstrom fyi, i realized these bugs after merging the PR and thinking more about the rule. My turn around time on PRs has been poor so i decided to fix them myself since I had some time today.