gherkin 2.5.4-x86-mswin32 → 2.6.0-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/Gemfile.lock +9 -7
- data/History.md +11 -1
- data/README.md +1 -1
- data/features/json_formatter.feature +376 -310
- data/features/json_parser.feature +245 -228
- data/features/step_definitions/json_formatter_steps.rb +7 -4
- data/features/step_definitions/json_parser_steps.rb +1 -1
- data/features/step_definitions/pretty_formatter_steps.rb +2 -1
- data/gherkin.gemspec +4 -3
- data/lib/1.8/gherkin_lexer_ar.so +0 -0
- data/lib/1.8/gherkin_lexer_bg.so +0 -0
- data/lib/1.8/gherkin_lexer_ca.so +0 -0
- data/lib/1.8/gherkin_lexer_cs.so +0 -0
- data/lib/1.8/gherkin_lexer_cy_gb.so +0 -0
- data/lib/1.8/gherkin_lexer_da.so +0 -0
- data/lib/1.8/gherkin_lexer_de.so +0 -0
- data/lib/1.8/gherkin_lexer_en.so +0 -0
- data/lib/1.8/gherkin_lexer_en_au.so +0 -0
- data/lib/1.8/gherkin_lexer_en_lol.so +0 -0
- data/lib/1.8/gherkin_lexer_en_pirate.so +0 -0
- data/lib/1.8/gherkin_lexer_en_scouse.so +0 -0
- data/lib/1.8/gherkin_lexer_en_tx.so +0 -0
- data/lib/1.8/gherkin_lexer_eo.so +0 -0
- data/lib/1.8/gherkin_lexer_es.so +0 -0
- data/lib/1.8/gherkin_lexer_et.so +0 -0
- data/lib/1.8/gherkin_lexer_fi.so +0 -0
- data/lib/1.8/gherkin_lexer_fr.so +0 -0
- data/lib/1.8/gherkin_lexer_he.so +0 -0
- data/lib/1.8/gherkin_lexer_hr.so +0 -0
- data/lib/1.8/gherkin_lexer_hu.so +0 -0
- data/lib/1.8/gherkin_lexer_id.so +0 -0
- data/lib/1.8/gherkin_lexer_is.so +0 -0
- data/lib/1.8/gherkin_lexer_it.so +0 -0
- data/lib/1.8/gherkin_lexer_ja.so +0 -0
- data/lib/1.8/gherkin_lexer_ko.so +0 -0
- data/lib/1.8/gherkin_lexer_lt.so +0 -0
- data/lib/1.8/gherkin_lexer_lu.so +0 -0
- data/lib/1.8/gherkin_lexer_lv.so +0 -0
- data/lib/1.8/gherkin_lexer_nl.so +0 -0
- data/lib/1.8/gherkin_lexer_no.so +0 -0
- data/lib/1.8/gherkin_lexer_pl.so +0 -0
- data/lib/1.8/gherkin_lexer_pt.so +0 -0
- data/lib/1.8/gherkin_lexer_ro.so +0 -0
- data/lib/1.8/gherkin_lexer_ru.so +0 -0
- data/lib/1.8/gherkin_lexer_sk.so +0 -0
- data/lib/1.8/gherkin_lexer_sr_cyrl.so +0 -0
- data/lib/1.8/gherkin_lexer_sr_latn.so +0 -0
- data/lib/1.8/gherkin_lexer_sv.so +0 -0
- data/lib/1.8/gherkin_lexer_tr.so +0 -0
- data/lib/1.8/gherkin_lexer_uk.so +0 -0
- data/lib/1.8/gherkin_lexer_uz.so +0 -0
- data/lib/1.8/gherkin_lexer_vi.so +0 -0
- data/lib/1.8/gherkin_lexer_zh_cn.so +0 -0
- data/lib/1.8/gherkin_lexer_zh_tw.so +0 -0
- data/lib/1.9/gherkin_lexer_ar.so +0 -0
- data/lib/1.9/gherkin_lexer_bg.so +0 -0
- data/lib/1.9/gherkin_lexer_ca.so +0 -0
- data/lib/1.9/gherkin_lexer_cs.so +0 -0
- data/lib/1.9/gherkin_lexer_cy_gb.so +0 -0
- data/lib/1.9/gherkin_lexer_da.so +0 -0
- data/lib/1.9/gherkin_lexer_de.so +0 -0
- data/lib/1.9/gherkin_lexer_en.so +0 -0
- data/lib/1.9/gherkin_lexer_en_au.so +0 -0
- data/lib/1.9/gherkin_lexer_en_lol.so +0 -0
- data/lib/1.9/gherkin_lexer_en_pirate.so +0 -0
- data/lib/1.9/gherkin_lexer_en_scouse.so +0 -0
- data/lib/1.9/gherkin_lexer_en_tx.so +0 -0
- data/lib/1.9/gherkin_lexer_eo.so +0 -0
- data/lib/1.9/gherkin_lexer_es.so +0 -0
- data/lib/1.9/gherkin_lexer_et.so +0 -0
- data/lib/1.9/gherkin_lexer_fi.so +0 -0
- data/lib/1.9/gherkin_lexer_fr.so +0 -0
- data/lib/1.9/gherkin_lexer_he.so +0 -0
- data/lib/1.9/gherkin_lexer_hr.so +0 -0
- data/lib/1.9/gherkin_lexer_hu.so +0 -0
- data/lib/1.9/gherkin_lexer_id.so +0 -0
- data/lib/1.9/gherkin_lexer_is.so +0 -0
- data/lib/1.9/gherkin_lexer_it.so +0 -0
- data/lib/1.9/gherkin_lexer_ja.so +0 -0
- data/lib/1.9/gherkin_lexer_ko.so +0 -0
- data/lib/1.9/gherkin_lexer_lt.so +0 -0
- data/lib/1.9/gherkin_lexer_lu.so +0 -0
- data/lib/1.9/gherkin_lexer_lv.so +0 -0
- data/lib/1.9/gherkin_lexer_nl.so +0 -0
- data/lib/1.9/gherkin_lexer_no.so +0 -0
- data/lib/1.9/gherkin_lexer_pl.so +0 -0
- data/lib/1.9/gherkin_lexer_pt.so +0 -0
- data/lib/1.9/gherkin_lexer_ro.so +0 -0
- data/lib/1.9/gherkin_lexer_ru.so +0 -0
- data/lib/1.9/gherkin_lexer_sk.so +0 -0
- data/lib/1.9/gherkin_lexer_sr_cyrl.so +0 -0
- data/lib/1.9/gherkin_lexer_sr_latn.so +0 -0
- data/lib/1.9/gherkin_lexer_sv.so +0 -0
- data/lib/1.9/gherkin_lexer_tr.so +0 -0
- data/lib/1.9/gherkin_lexer_uk.so +0 -0
- data/lib/1.9/gherkin_lexer_uz.so +0 -0
- data/lib/1.9/gherkin_lexer_vi.so +0 -0
- data/lib/1.9/gherkin_lexer_zh_cn.so +0 -0
- data/lib/1.9/gherkin_lexer_zh_tw.so +0 -0
- data/lib/gherkin/formatter/json_formatter.rb +13 -9
- data/lib/gherkin/formatter/model.rb +78 -20
- data/lib/gherkin/formatter/pretty_formatter.rb +1 -1
- data/lib/gherkin/json_parser.rb +32 -24
- data/lib/gherkin/listener/formatter_listener.rb +76 -50
- data/spec/gherkin/fixtures/complex.json +8 -1
- data/spec/gherkin/formatter/json_formatter_spec.rb +49 -43
- data/spec/gherkin/formatter/model_spec.rb +2 -2
- data/spec/gherkin/formatter/pretty_formatter_spec.rb +10 -10
- data/spec/gherkin/json_parser_spec.rb +93 -77
- data/spec/gherkin/sexp_recorder.rb +0 -3
- metadata +25 -25
data/lib/gherkin/json_parser.rb
CHANGED
@@ -16,21 +16,23 @@ module Gherkin
|
|
16
16
|
|
17
17
|
# Parse a gherkin object +o+, which can either be a JSON String,
|
18
18
|
# or a Hash (from a parsed JSON String).
|
19
|
-
def parse(o
|
19
|
+
def parse(o)
|
20
20
|
o = JSON.parse(o) if String === o
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
21
|
+
|
22
|
+
o.each do |f|
|
23
|
+
@formatter.uri(f['uri'])
|
24
|
+
Formatter::Model::Feature.new(comments(f), tags(f), keyword(f), name(f), description(f), line(f), id(f)).replay(@formatter)
|
25
|
+
(f["elements"] || []).each do |feature_element|
|
26
|
+
feature_element(feature_element).replay(@formatter)
|
27
|
+
(feature_element["steps"] || []).each do |step|
|
28
|
+
step(step).replay(@formatter)
|
29
|
+
match(step)
|
30
|
+
result(step)
|
31
|
+
embeddings(step)
|
32
|
+
end
|
33
|
+
(feature_element["examples"] || []).each do |eo|
|
34
|
+
Formatter::Model::Examples.new(comments(eo), tags(eo), keyword(eo), name(eo), description(eo), line(eo), id(eo), examples_rows(eo['rows'])).replay(@formatter)
|
35
|
+
end
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
@@ -44,23 +46,25 @@ module Gherkin
|
|
44
46
|
when 'background'
|
45
47
|
Formatter::Model::Background.new(comments(o), keyword(o), name(o), description(o), line(o))
|
46
48
|
when 'scenario'
|
47
|
-
Formatter::Model::Scenario.new(comments(o), tags(o), keyword(o), name(o), description(o), line(o))
|
49
|
+
Formatter::Model::Scenario.new(comments(o), tags(o), keyword(o), name(o), description(o), line(o), id(o))
|
48
50
|
when 'scenario_outline'
|
49
|
-
Formatter::Model::ScenarioOutline.new(comments(o), tags(o), keyword(o), name(o), description(o), line(o))
|
51
|
+
Formatter::Model::ScenarioOutline.new(comments(o), tags(o), keyword(o), name(o), description(o), line(o), id(o))
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
53
55
|
def step(o)
|
54
|
-
|
56
|
+
builder = Formatter::Model::Step::Builder.new(comments(o), keyword(o), name(o), line(o))
|
57
|
+
|
58
|
+
(o['rows'] || []).each do |row|
|
59
|
+
builder.row comments(row), row['cells'], row['line'], nil
|
60
|
+
end
|
55
61
|
|
56
|
-
if(o['
|
57
|
-
step.rows = rows(o['rows'])
|
58
|
-
elsif(o['doc_string'])
|
62
|
+
if(o['doc_string'])
|
59
63
|
ds = o['doc_string']
|
60
|
-
|
64
|
+
builder.doc_string ds['value'], ds['content_type'].to_s, ds['line']
|
61
65
|
end
|
62
66
|
|
63
|
-
|
67
|
+
builder.build
|
64
68
|
end
|
65
69
|
|
66
70
|
def match(o)
|
@@ -81,8 +85,8 @@ module Gherkin
|
|
81
85
|
end
|
82
86
|
end
|
83
87
|
|
84
|
-
def
|
85
|
-
o.map{|row| Formatter::Model::
|
88
|
+
def examples_rows(o)
|
89
|
+
o.map{|row| Formatter::Model::ExamplesTableRow.new(comments(row), row['cells'], row['line'], row['id'])}
|
86
90
|
end
|
87
91
|
|
88
92
|
def comments(o)
|
@@ -113,6 +117,10 @@ module Gherkin
|
|
113
117
|
o['line']
|
114
118
|
end
|
115
119
|
|
120
|
+
def id(o)
|
121
|
+
o['id']
|
122
|
+
end
|
123
|
+
|
116
124
|
def arguments(m)
|
117
125
|
m['arguments'].map{|a| Formatter::Argument.new(a['offset'], a['val'])}
|
118
126
|
end
|
@@ -11,54 +11,65 @@ module Gherkin
|
|
11
11
|
|
12
12
|
def initialize(formatter)
|
13
13
|
@formatter = formatter
|
14
|
-
@
|
15
|
-
@tags = []
|
16
|
-
@table = nil
|
14
|
+
@stash = Stash.new
|
17
15
|
end
|
18
16
|
|
19
17
|
def comment(value, line)
|
20
|
-
@
|
18
|
+
@stash.comment Formatter::Model::Comment.new(value, line)
|
21
19
|
end
|
22
20
|
|
23
21
|
def tag(name, line)
|
24
|
-
@
|
22
|
+
@stash.tag Formatter::Model::Tag.new(name, line)
|
25
23
|
end
|
26
24
|
|
27
25
|
def feature(keyword, name, description, line)
|
28
|
-
@
|
26
|
+
@stash.feature(name) do |comments, tags, id|
|
27
|
+
replay Formatter::Model::Feature.new(comments, tags, keyword, name, description, line, id)
|
28
|
+
end
|
29
29
|
end
|
30
30
|
|
31
31
|
def background(keyword, name, description, line)
|
32
|
-
@
|
32
|
+
@stash.feature_element(name) do |comments, tags, id|
|
33
|
+
replay Formatter::Model::Background.new(comments, keyword, name, description, line)
|
34
|
+
end
|
33
35
|
end
|
34
36
|
|
35
37
|
def scenario(keyword, name, description, line)
|
36
38
|
replay_step_or_examples
|
37
|
-
@
|
39
|
+
@stash.feature_element(name) do |comments, tags, id|
|
40
|
+
replay Formatter::Model::Scenario.new(comments, tags, keyword, name, description, line, id)
|
41
|
+
end
|
38
42
|
end
|
39
43
|
|
40
44
|
def scenario_outline(keyword, name, description, line)
|
41
45
|
replay_step_or_examples
|
42
|
-
@
|
46
|
+
@stash.feature_element(name) do |comments, tags, id|
|
47
|
+
replay Formatter::Model::ScenarioOutline.new(comments, tags, keyword, name, description, line, id)
|
48
|
+
end
|
43
49
|
end
|
44
50
|
|
45
51
|
def examples(keyword, name, description, line)
|
46
52
|
replay_step_or_examples
|
47
|
-
@
|
53
|
+
@stash.examples(name) do |comments, tags, id|
|
54
|
+
@current_builder = Formatter::Model::Examples::Builder.new(comments, tags, keyword, name, description, line, id)
|
55
|
+
end
|
48
56
|
end
|
49
57
|
|
50
58
|
def step(keyword, name, line)
|
51
59
|
replay_step_or_examples
|
52
|
-
@
|
60
|
+
@stash.basic_statement do |comments|
|
61
|
+
@current_builder = Formatter::Model::Step::Builder.new(comments, keyword, name, line)
|
62
|
+
end
|
53
63
|
end
|
54
64
|
|
55
65
|
def row(cells, line)
|
56
|
-
@
|
57
|
-
|
66
|
+
@stash.basic_statement do |comments, id|
|
67
|
+
@current_builder.row(comments, cells, line, id)
|
68
|
+
end
|
58
69
|
end
|
59
70
|
|
60
|
-
def doc_string(
|
61
|
-
@doc_string
|
71
|
+
def doc_string(content_type, value, line)
|
72
|
+
@current_builder.doc_string(value, content_type, line)
|
62
73
|
end
|
63
74
|
|
64
75
|
def eof
|
@@ -71,46 +82,61 @@ module Gherkin
|
|
71
82
|
end
|
72
83
|
|
73
84
|
private
|
85
|
+
|
86
|
+
def replay(element)
|
87
|
+
element.replay(@formatter)
|
88
|
+
end
|
89
|
+
|
90
|
+
class Stash
|
91
|
+
attr_reader :comments, :tags, :ids
|
92
|
+
|
93
|
+
def initialize
|
94
|
+
@comments, @tags, @ids = [], [], []
|
95
|
+
@row_index = 0
|
96
|
+
end
|
97
|
+
|
98
|
+
def comment(comment)
|
99
|
+
@comments << comment
|
100
|
+
end
|
101
|
+
|
102
|
+
def feature(name)
|
103
|
+
@feature_id = id(name)
|
104
|
+
yield @comments, @tags, @feature_id
|
105
|
+
@comments, @tags = [], []
|
106
|
+
end
|
74
107
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
108
|
+
def feature_element(name)
|
109
|
+
@feature_element_id = "#{@feature_id};#{id(name)}"
|
110
|
+
yield @comments, @tags, @feature_element_id
|
111
|
+
@comments, @tags = [], []
|
112
|
+
end
|
113
|
+
|
114
|
+
def examples(name)
|
115
|
+
@examples_id = "#{@feature_element_id};#{id(name)}"
|
116
|
+
@row_index = 0
|
117
|
+
yield @comments, @tags, @examples_id
|
118
|
+
@comments, @tags = [], []
|
119
|
+
end
|
120
|
+
|
121
|
+
def basic_statement
|
122
|
+
@row_index += 1
|
123
|
+
yield @comments, "#{@examples_id};#{@row_index}"
|
124
|
+
@comments = []
|
125
|
+
end
|
126
|
+
|
127
|
+
def tag(tag)
|
128
|
+
@tags << tag
|
129
|
+
end
|
92
130
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
doc_string
|
131
|
+
def id(name)
|
132
|
+
(name || '').gsub(/[\s_]/, '-').downcase
|
133
|
+
end
|
97
134
|
end
|
98
135
|
|
99
136
|
def replay_step_or_examples
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
elsif(rows = grab_rows!)
|
104
|
-
@step_statement.rows = rows
|
105
|
-
end
|
106
|
-
@formatter.step(@step_statement)
|
107
|
-
@step_statement = nil
|
108
|
-
end
|
109
|
-
if(@examples_statement)
|
110
|
-
@examples_statement.rows = grab_rows!
|
111
|
-
@formatter.examples(@examples_statement)
|
112
|
-
@examples_statement = nil
|
113
|
-
end
|
137
|
+
return unless @current_builder
|
138
|
+
replay(@current_builder)
|
139
|
+
@current_builder = nil
|
114
140
|
end
|
115
141
|
end
|
116
142
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"id": "feature-text",
|
3
|
+
"uri": "some/nice.feature",
|
2
4
|
"name": "Feature Text",
|
3
5
|
"keyword": "Feature",
|
4
6
|
"description": "In order to test multiline forms",
|
@@ -20,6 +22,7 @@
|
|
20
22
|
]
|
21
23
|
},
|
22
24
|
{ "type": "scenario_outline",
|
25
|
+
"id": "feature-text/a-scenario-outline",
|
23
26
|
"keyword": "Scenario Outline",
|
24
27
|
"name": "An Scenario Outline",
|
25
28
|
"description": "",
|
@@ -36,6 +39,7 @@
|
|
36
39
|
],
|
37
40
|
"examples": [
|
38
41
|
{
|
42
|
+
"id": "feature-text/a-scenario-outline/sweet-example",
|
39
43
|
"name": "Sweet Example",
|
40
44
|
"keyword": "Examples",
|
41
45
|
"description": "",
|
@@ -52,6 +56,7 @@
|
|
52
56
|
]
|
53
57
|
},
|
54
58
|
{ "type" : "scenario",
|
59
|
+
"id": "feature-text/reading-a-scenario",
|
55
60
|
"keyword": "Scenario",
|
56
61
|
"name" : "Reading a Scenario",
|
57
62
|
"description": "",
|
@@ -67,6 +72,7 @@
|
|
67
72
|
]
|
68
73
|
},
|
69
74
|
{ "type" : "scenario",
|
75
|
+
"id": "feature-text/reading-a-second-scenario",
|
70
76
|
"keyword": "Scenario",
|
71
77
|
"name" : "Reading a second scenario",
|
72
78
|
"description": "With two lines of text",
|
@@ -111,6 +117,7 @@
|
|
111
117
|
]
|
112
118
|
},
|
113
119
|
{ "type" : "scenario",
|
120
|
+
"id": "feature-text/hammerzeit",
|
114
121
|
"keyword": "Scenario",
|
115
122
|
"name" : "Hammerzeit",
|
116
123
|
"description": "",
|
@@ -10,10 +10,10 @@ module Gherkin
|
|
10
10
|
io = StringIO.new
|
11
11
|
f = JSONFormatter.new(io)
|
12
12
|
f.uri("f.feature")
|
13
|
-
f.feature(Model::Feature.new([], [], "Feature", "
|
14
|
-
f.scenario(Model::Scenario.new([], [], "
|
15
|
-
f.step(Model::Step.new([], "Given ", "g", 3))
|
16
|
-
f.step(Model::Step.new([], "When ", "w", 4))
|
13
|
+
f.feature(Model::Feature.new([], [], "Feature", "ff", "", 1, "ff"))
|
14
|
+
f.scenario(Model::Scenario.new([], [], "Scenario", "ss", "", 2, "ff/ss"))
|
15
|
+
f.step(Model::Step.new([], "Given ", "g", 3, nil, nil))
|
16
|
+
f.step(Model::Step.new([], "When ", "w", 4, nil, nil))
|
17
17
|
|
18
18
|
f.match(Model::Match.new([], "def.rb:33"))
|
19
19
|
f.result(Model::Result.new(:passed, 1, nil))
|
@@ -22,49 +22,55 @@ module Gherkin
|
|
22
22
|
f.result(Model::Result.new(:passed, 1, nil))
|
23
23
|
|
24
24
|
f.eof
|
25
|
+
f.close
|
25
26
|
|
26
27
|
expected = %{
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
"
|
28
|
+
[
|
29
|
+
{
|
30
|
+
"id": "ff",
|
31
|
+
"uri": "f.feature",
|
32
|
+
"keyword": "Feature",
|
33
|
+
"name": "ff",
|
34
|
+
"line": 1,
|
35
|
+
"description": "",
|
36
|
+
"elements": [
|
37
|
+
{
|
38
|
+
"id": "ff/ss",
|
39
|
+
"keyword": "Scenario",
|
40
|
+
"name": "ss",
|
41
|
+
"line": 2,
|
42
|
+
"description": "",
|
43
|
+
"type": "scenario",
|
44
|
+
"steps": [
|
45
|
+
{
|
46
|
+
"keyword": "Given ",
|
47
|
+
"name": "g",
|
48
|
+
"line": 3,
|
49
|
+
"match": {
|
50
|
+
"location": "def.rb:33"
|
51
|
+
},
|
52
|
+
"result": {
|
53
|
+
"status": "passed",
|
54
|
+
"duration": 1
|
55
|
+
}
|
46
56
|
},
|
47
|
-
|
48
|
-
"
|
49
|
-
"
|
57
|
+
{
|
58
|
+
"keyword": "When ",
|
59
|
+
"name": "w",
|
60
|
+
"line": 4,
|
61
|
+
"match": {
|
62
|
+
"location": "def.rb:44"
|
63
|
+
},
|
64
|
+
"result": {
|
65
|
+
"status": "passed",
|
66
|
+
"duration": 1
|
67
|
+
}
|
50
68
|
}
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
"match": {
|
57
|
-
"location": "def.rb:44"
|
58
|
-
},
|
59
|
-
"result": {
|
60
|
-
"status": "passed",
|
61
|
-
"duration": 1
|
62
|
-
}
|
63
|
-
}
|
64
|
-
]
|
65
|
-
}
|
66
|
-
]
|
67
|
-
}
|
69
|
+
]
|
70
|
+
}
|
71
|
+
]
|
72
|
+
}
|
73
|
+
]
|
68
74
|
}
|
69
75
|
|
70
76
|
JSON.parse(expected).should == JSON.parse(io.string)
|
@@ -14,12 +14,12 @@ module Gherkin
|
|
14
14
|
|
15
15
|
describe Step do
|
16
16
|
it "should provide arguments for outline tokens" do
|
17
|
-
step = Step.new([], 'Given ', "I have <number> cukes in <whose> belly", 10)
|
17
|
+
step = Step.new([], 'Given ', "I have <number> cukes in <whose> belly", 10, nil, nil)
|
18
18
|
step.outline_args.map{|arg| [arg.offset, arg.val]}.should == [[7, "<number>"], [25, "<whose>"]]
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should provide no arguments when there are no outline tokens" do
|
22
|
-
step = Step.new([], 'Given ', "I have 33 cukes in my belly", 10)
|
22
|
+
step = Step.new([], 'Given ', "I have 33 cukes in my belly", 10, nil, nil)
|
23
23
|
step.outline_args.to_a.should == []
|
24
24
|
end
|
25
25
|
end
|