-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbad_scenario_name.feature
53 lines (46 loc) · 1.31 KB
/
bad_scenario_name.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Feature: Bad Scenario Name
As a Business Analyst
I want to be warned about invalid scenario names
so that I am able to look for better naming
Background: Prepare Testee
Given a file named "lint.rb" with:
"""
$LOAD_PATH << '../../lib'
require 'gherkin_lint'
linter = GherkinLint::GherkinLint.new
linter.enable %w(BadScenarioName)
linter.set_linter
linter.analyze 'lint.feature'
exit linter.report
"""
Scenario Outline: Bad Scenario Names
Given a file named "lint.feature" with:
"""
Feature: Test
Scenario: <bad word> something
"""
When I run `ruby lint.rb`
Then it should fail with exactly:
"""
BadScenarioName - Prefer to rely just on Given and When steps when name your scenario to keep it stable
lint.feature (2): Test.<bad word> something
"""
Examples: Words to avoid
| bad word |
| Verifies |
| Verification |
| Verify |
| Checks |
| Check |
| Tests |
| Test |
Scenario: Valid Example
Given a file named "lint.feature" with:
"""
Feature: Test
Scenario: Suitable Scenario Name
"""
When I run `ruby lint.rb`
Then it should pass with exactly:
"""
"""