/
unused_variable.feature
104 lines (93 loc) · 2.3 KB
/
unused_variable.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
@disableUnknownVariable
Feature: Unused Variable
As a Business Analyst
I want to be warned about unused variables
so that I can delete them if they are not used anymore or refer them again
Background:
Given chutney is configured with the linter "Chutney::UnusedVariable"
Scenario: Unused Step Variable
And a feature file contains:
"""
Feature: Test
Scenario Outline: A
When <bar>
Examples: Values
| bar | foo |
| 1 | 2 |
"""
When I run Chutney
Then 1 issue is raised
And the message is:
"""
The variable 'foo' is declared but never used.
"""
And it is reported on:
| line | column |
| 5 | 5 |
Scenario: Unused Table Variable
And a feature file contains:
"""
Feature: Test
Scenario Outline: A
When test
| value |
| <bar> |
Examples: Values
| bar | foo |
| 1 | 2 |
"""
When I run Chutney
Then 1 issue is raised
And the message is:
"""
The variable 'foo' is declared but never used.
"""
And it is reported on:
| line | column |
| 7 | 5 |
Scenario: Unused Pystring Variable
And a feature file contains:
"""
Feature: Test
Scenario Outline: A
When test
\"\"\"
<bar>
\"\"\"
Examples: Values
| bar | foo |
| 1 | 2 |
"""
When I run Chutney
Then 1 issue is raised
And the message is:
"""
The variable 'foo' is declared but never used.
"""
And it is reported on:
| line | column |
| 8 | 5 |
Scenario: Valid Example
And a feature file contains:
"""
Feature: Test
Scenario Outline: A
Given <first>
| value |
| <second> |
When test
\"\"\"
<third>
\"\"\"
Examples: Test
| first | second | third |
| used value | used | also |
"""
When I run Chutney
Then 0 issues are raised
Scenario: Defect Test - Empty Feature
And a feature file contains:
"""
"""
When I run Chutney
Then 0 issues are raised