-
Notifications
You must be signed in to change notification settings - Fork 14
/
unique_scenario_names.feature
46 lines (40 loc) · 1.13 KB
/
unique_scenario_names.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
Feature: Unique Scenario Names
As a Customer
I want unique scenario names
so that I can refer to them in case of issues
Background: Prepare Testee
Given a file named "lint.rb" with:
"""
$LOAD_PATH << '../../lib'
require 'gherkin_lint'
linter = GherkinLint::GherkinLint.new
linter.enable %w(UniqueScenarioNames)
linter.set_linter
linter.analyze 'lint.feature'
exit linter.report
"""
Scenario: Unique Scenario Name for empty scenarios
Given a file named "lint.feature" with:
"""
Feature: Unique Scenario Names
Scenario: A
Scenario: A
"""
When I run `ruby lint.rb`
Then it should fail with exactly:
"""
UniqueScenarioNames - 'Unique Scenario Names.A' used 2 times
lint.feature (2): Unique Scenario Names.A
lint.feature (3): Unique Scenario Names.A
"""
Scenario: Valid Example
Given a file named "lint.feature" with:
"""
Feature: Unique Scenario Names
Scenario: A
Scenario: B
"""
When I run `ruby lint.rb`
Then it should pass with exactly:
"""
"""