-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathdoc_string.feature
48 lines (44 loc) · 1.66 KB
/
doc_string.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
Feature: doc string
Scenario: as only step definition argument
Given a file named "features/a.feature" with:
"""
Feature: a feature
Scenario: a scenario
Given a doc string step
\"\"\"
The cucumber (Cucumis sativus) is a widely cultivated plant in the gourd family Cucurbitaceae.
\"\"\"
"""
And a file named "features/step_definitions/cucumber_steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
const assert = require('assert')
Given(/^a doc string step$/, function(docString) {
assert.equal(docString, "The cucumber (Cucumis sativus) is a widely " +
"cultivated plant in the gourd family Cucurbitaceae.")
})
"""
When I run cucumber-js
Then it passes
Scenario: with other step definition arguments
Given a file named "features/a.feature" with:
"""
Feature: a feature
Scenario: a scenario
Given a "doc string" step
\"\"\"
The cucumber (Cucumis sativus) is a widely cultivated plant in the gourd family Cucurbitaceae.
\"\"\"
"""
And a file named "features/step_definitions/cucumber_steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')
const assert = require('assert')
Given(/^a "([^"]*)" step$/, function(type, docString) {
assert.equal(type, "doc string")
assert.equal(docString, "The cucumber (Cucumis sativus) is a widely " +
"cultivated plant in the gourd family Cucurbitaceae.")
})
"""
When I run cucumber-js
Then it passes