-
Notifications
You must be signed in to change notification settings - Fork 73
/
use-and.js
51 lines (49 loc) · 1.36 KB
/
use-and.js
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
var ruleTestBase = require('../rule-test-base');
var rule = require('../../../dist/rules/use-and.js');
var runTest = ruleTestBase.createRuleTest(rule,
'Step "<%= keyword %><%= text %>" should use And instead of <%= keyword %>');
describe('Use And Rule', function() {
it('doesn\'t raise errors when there are no violations', function() {
runTest('use-and/NoViolations.feature', {}, []);
});
it('raises erros when there are violations', function() {
runTest('use-and/Violations.feature', {}, [
{
messageElements: { keyword: 'Given ', text: 'step5'},
line: 5
},
{
messageElements: { keyword: 'When ', text: 'step8'},
line: 8
},
{
messageElements: { keyword: 'Then ', text: 'step11'},
line: 11
},
{
messageElements: { keyword: 'Given ', text: 'step16'},
line: 16
},
{
messageElements: { keyword: 'When ', text: 'step19'},
line: 19
},
{
messageElements: { keyword: 'Then ', text: 'step22'},
line: 22
},
{
messageElements: { keyword: 'Given ', text: 'step27'},
line: 27
},
{
messageElements: { keyword: 'When ', text: 'step30'},
line: 30
},
{
messageElements: { keyword: 'Then ', text: 'step33'},
line: 33
}
]);
});
});