-
Notifications
You must be signed in to change notification settings - Fork 14
/
be_declarative.feature
53 lines (47 loc) · 1.36 KB
/
be_declarative.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: Be Declarative
As a Customer
I want to read declarative scenarios
so that I'm able to understand how to set the system in the state and how to prove the state
Background: Prepare Testee
Given a file named "lint.rb" with:
"""
$LOAD_PATH << '../../lib'
require 'gherkin_lint'
linter = GherkinLint::GherkinLint.new
linter.enable %w(BeDeclarative)
linter.set_linter
linter.analyze 'lint.feature'
exit linter.report
"""
Scenario: Non Declarative Scenario
Given a file named "lint.feature" with:
"""
Feature: Test
Scenario: A
Given a number 1
And another number 2
When add these numbers
Then the result is 3
"""
When I run `ruby lint.rb`
Then it should pass with exactly:
"""
BeDeclarative (Warning) - no verb
lint.feature (3): Test.A step: a number 1
BeDeclarative (Warning) - no verb
lint.feature (4): Test.A step: another number 2
"""
Scenario: Valid Example
Given a file named "lint.feature" with:
"""
Feature: Test
Scenario: A
Given a number is set to 1
And another number is set to 2
When add these numbers
Then the result is 3
"""
When I run `ruby lint.rb`
Then it should pass with exactly:
"""
"""