-
Notifications
You must be signed in to change notification settings - Fork 14
/
missing_example_name.feature
87 lines (75 loc) · 1.97 KB
/
missing_example_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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@disableUnknownVariable
Feature: Missing Example Name
As a Customer
I want examples to be named
so that I'm able to understand why this example exists
Background: Prepare Testee
Given a file named "lint.rb" with:
"""
$LOAD_PATH << '../../lib'
require 'gherkin_lint'
linter = GherkinLint::GherkinLint.new
linter.enable %w(MissingExampleName)
linter.set_linter
linter.analyze 'lint.feature'
exit linter.report
"""
Scenario: Missing Example Name
Given a file named "lint.feature" with:
"""
Feature: Test
Scenario Outline: A
When test
Then <value>
Examples:
| value |
| test |
Examples:
| value |
| test |
"""
When I run `ruby lint.rb`
Then it should fail with exactly:
"""
MissingExampleName - No Example Name
lint.feature (2): Test.A
MissingExampleName - No Example Name
lint.feature (2): Test.A
"""
Scenario: Names could be omitted for scenarios with a single example
Given a file named "lint.feature" with:
"""
Feature: Test
Scenario Outline: A
When test
Then <value>
Examples:
| value |
| test |
"""
When I run `ruby lint.rb`
Then it should pass with exactly:
"""
"""
Scenario: Valid Example
Given a file named "lint.feature" with:
"""
Feature: Test
Scenario Outline: A
When stress with <list>
And with <character>
Then program does not crash
Examples: Cardinality
| list |
| A |
| A and B |
| A, B, and C |
Examples: Non Ascii Characters
| character |
| ä |
| ß |
"""
When I run `ruby lint.rb`
Then it should pass with exactly:
"""
"""