aslakhellesoy-cucumber 0.1.16.4 → 0.1.16.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +75 -1
- data/Manifest.txt +58 -65
- data/examples/cs/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/Rakefile +3 -3
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -6
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +1 -1
- data/examples/i18n/de/features/addition.feature +6 -6
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/i18n/en/features/addition.feature +6 -6
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +1 -1
- data/examples/i18n/et/features/liitmine.feature +7 -6
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +1 -1
- data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +1 -1
- data/examples/i18n/fi/features/yhteenlasku.feature +2 -2
- data/examples/i18n/fr/features/addition.feature +2 -2
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +1 -1
- data/examples/i18n/id/features/addition.feature +6 -6
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +1 -1
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +2 -3
- data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/lt/features/addition.feature +7 -6
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +7 -7
- data/examples/i18n/no/features/summering.feature +1 -0
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +1 -1
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +1 -1
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/jbehave/README.textile +17 -0
- data/examples/jbehave/features/support/env.rb +7 -0
- data/examples/jbehave/features/trading.feature +24 -0
- data/examples/jbehave/pom.xml +48 -0
- data/examples/self_test/README.textile +4 -1
- data/examples/self_test/features/call_undefined_step_from_step_def.feature +7 -0
- data/examples/self_test/features/lots_of_undefined.feature +8 -0
- data/examples/self_test/features/outline_sample.feature +8 -5
- data/examples/self_test/features/sample.feature +5 -3
- data/examples/self_test/features/step_definitions/sample_steps.rb +15 -3
- data/features/cucumber_cli.feature +199 -97
- data/features/cucumber_cli_outlines.feature +46 -38
- data/features/report_called_undefined_steps.feature +31 -0
- data/features/step_definitions/cucumber_steps.rb +7 -3
- data/features/step_definitions/extra_steps.rb +1 -1
- data/features/support/env.rb +1 -1
- data/gem_tasks/features.rake +1 -1
- data/gem_tasks/flog.rake +1 -1
- data/lib/autotest/cucumber_mixin.rb +16 -23
- data/lib/cucumber/ast/comment.rb +26 -0
- data/lib/cucumber/ast/examples.rb +22 -0
- data/lib/cucumber/ast/feature.rb +60 -0
- data/lib/cucumber/ast/features.rb +39 -0
- data/lib/cucumber/ast/filter.rb +22 -0
- data/lib/cucumber/ast/outline_table.rb +49 -0
- data/lib/cucumber/ast/py_string.rb +52 -0
- data/lib/cucumber/ast/scenario.rb +91 -0
- data/lib/cucumber/ast/scenario_outline.rb +83 -0
- data/lib/cucumber/ast/step.rb +130 -0
- data/lib/cucumber/ast/table.rb +214 -0
- data/lib/cucumber/ast/tags.rb +33 -0
- data/lib/cucumber/ast/visitor.rb +93 -0
- data/lib/cucumber/ast.rb +27 -0
- data/lib/cucumber/broadcaster.rb +1 -6
- data/lib/cucumber/cli.rb +178 -128
- data/lib/cucumber/core_ext/exception.rb +41 -8
- data/lib/cucumber/core_ext/instance_exec.rb +54 -0
- data/lib/cucumber/core_ext/proc.rb +29 -65
- data/lib/cucumber/core_ext/string.rb +19 -0
- data/lib/cucumber/{formatters → formatter}/ansicolor.rb +11 -10
- data/lib/cucumber/formatter/console.rb +116 -0
- data/lib/cucumber/formatter/pretty.rb +158 -0
- data/lib/cucumber/formatter/profile.rb +77 -0
- data/lib/cucumber/formatter/progress.rb +68 -0
- data/lib/cucumber/formatter.rb +1 -0
- data/lib/cucumber/formatters/autotest_formatter.rb +0 -2
- data/lib/cucumber/formatters/html_formatter.rb +4 -3
- data/lib/cucumber/formatters/pretty_formatter.rb +1 -1
- data/lib/cucumber/formatters/unicode.rb +3 -3
- data/lib/cucumber/jbehave.rb +104 -0
- data/lib/cucumber/languages.yml +100 -73
- data/lib/cucumber/parser/basic.rb +0 -0
- data/lib/cucumber/parser/feature.rb +1694 -0
- data/lib/cucumber/parser/feature.tt +206 -0
- data/lib/cucumber/parser/file_parser.rb +50 -0
- data/lib/cucumber/parser/i18n.tt +26 -0
- data/lib/cucumber/parser/treetop_ext.rb +9 -0
- data/lib/cucumber/parser.rb +27 -0
- data/lib/cucumber/platform.rb +3 -17
- data/lib/cucumber/step_definition.rb +83 -0
- data/lib/cucumber/step_mother.rb +128 -72
- data/lib/cucumber/version.rb +1 -1
- data/lib/cucumber.rb +56 -9
- data/spec/cucumber/ast/feature_factory.rb +54 -0
- data/spec/cucumber/ast/feature_spec.rb +60 -0
- data/spec/cucumber/ast/py_string_spec.rb +40 -0
- data/spec/cucumber/ast/scenario_outline_spec.rb +64 -0
- data/spec/cucumber/ast/scenario_spec.rb +82 -0
- data/spec/cucumber/ast/step_spec.rb +45 -0
- data/spec/cucumber/ast/table_spec.rb +81 -0
- data/spec/cucumber/broadcaster_spec.rb +4 -17
- data/spec/cucumber/cli_spec.rb +43 -148
- data/spec/cucumber/core_ext/proc_spec.rb +27 -35
- data/spec/cucumber/core_ext/string_spec.rb +8 -0
- data/spec/cucumber/{formatters → formatter}/ansicolor_spec.rb +2 -2
- data/spec/cucumber/formatter/html/cucumber.css +37 -0
- data/spec/cucumber/formatter/html/cucumber.js +11 -0
- data/spec/cucumber/formatter/html/index.html +45 -0
- data/spec/cucumber/formatter/html/jquery-1.3.min.js +19 -0
- data/spec/cucumber/formatter/html/jquery.uitableedit.js +100 -0
- data/spec/cucumber/formatters/autotest_formatter_spec.rb +1 -0
- data/spec/cucumber/formatters/profile_formatter_spec.rb +17 -16
- data/spec/cucumber/parser/feature_parser_spec.rb +247 -0
- data/spec/cucumber/parser/table_parser_spec.rb +48 -0
- data/spec/cucumber/step_definition_spec.rb +62 -0
- data/spec/cucumber/step_mom_spec.rb +49 -0
- data/spec/cucumber/treetop_parser/empty_feature.feature +1 -1
- data/spec/cucumber/treetop_parser/spaces.feature +3 -1
- data/spec/cucumber/treetop_parser/with_comments.feature +1 -1
- data/spec/cucumber/treetop_parser/with_tags.feature +18 -0
- data/spec/cucumber/world/pending_spec.rb +13 -12
- data/spec/spec_helper.rb +1 -1
- metadata +59 -67
- data/examples/calculator_ruby_features/Rakefile +0 -6
- data/examples/calculator_ruby_features/features/addition.rb +0 -39
- data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +0 -43
- data/gem_tasks/treetop.rake +0 -41
- data/lib/cucumber/executor.rb +0 -205
- data/lib/cucumber/formatters/profile_formatter.rb +0 -92
- data/lib/cucumber/formatters/progress_formatter.rb +0 -61
- data/lib/cucumber/formatters.rb +0 -1
- data/lib/cucumber/model/table.rb +0 -32
- data/lib/cucumber/model.rb +0 -1
- data/lib/cucumber/step_methods.rb +0 -49
- data/lib/cucumber/tree/feature.rb +0 -105
- data/lib/cucumber/tree/features.rb +0 -21
- data/lib/cucumber/tree/given_scenario.rb +0 -13
- data/lib/cucumber/tree/scenario.rb +0 -240
- data/lib/cucumber/tree/step.rb +0 -173
- data/lib/cucumber/tree/table.rb +0 -26
- data/lib/cucumber/tree/top_down_visitor.rb +0 -23
- data/lib/cucumber/tree.rb +0 -16
- data/lib/cucumber/treetop_parser/feature.treetop.erb +0 -254
- data/lib/cucumber/treetop_parser/feature_ar.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_cy.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_da.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_de.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_en-lol.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_en-tx.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_en.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_es.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_et.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_fr.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_id.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_it.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ja.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ko.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_lt.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_nl.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_no.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_parser.rb +0 -36
- data/lib/cucumber/treetop_parser/feature_pl.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_pt.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ro.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ro2.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ru.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_se.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_zh-CN.rb +0 -1951
- data/lib/cucumber/world/pending.rb +0 -22
- data/lib/cucumber/world.rb +0 -1
- data/setup.rb +0 -1585
- data/spec/cucumber/executor_spec.rb +0 -382
- data/spec/cucumber/formatters/html_formatter_spec.rb +0 -104
- data/spec/cucumber/formatters/pretty_formatter_spec.rb +0 -410
- data/spec/cucumber/formatters/progress_formatter_spec.rb +0 -81
- data/spec/cucumber/model/table_spec.rb +0 -32
- data/spec/cucumber/step_mother_spec.rb +0 -74
- data/spec/cucumber/tree/feature_spec.rb +0 -122
- data/spec/cucumber/tree/row_scenario_outline_spec.rb +0 -73
- data/spec/cucumber/tree/row_scenario_spec.rb +0 -55
- data/spec/cucumber/tree/row_step_outline_spec.rb +0 -38
- data/spec/cucumber/tree/scenario_outline_spec.rb +0 -50
- data/spec/cucumber/tree/scenario_spec.rb +0 -134
- data/spec/cucumber/tree/step_outline_spec.rb +0 -17
- data/spec/cucumber/tree/step_spec.rb +0 -59
- data/spec/cucumber/treetop_parser/feature_parser_spec.rb +0 -120
@@ -1,99 +1,95 @@
|
|
1
1
|
Feature: Cucumber command line
|
2
2
|
In order to write better software
|
3
3
|
Developers should be able to execute requirements as tests
|
4
|
-
|
4
|
+
|
5
5
|
Scenario: Run single scenario with missing step definition
|
6
|
-
When I run cucumber -q features/sample.feature:
|
6
|
+
When I run cucumber -q features/sample.feature:5
|
7
7
|
Then it should pass with
|
8
8
|
"""
|
9
|
+
@one
|
9
10
|
Feature: Sample
|
11
|
+
|
12
|
+
@two @three
|
10
13
|
Scenario: Missing
|
11
14
|
Given missing
|
12
15
|
|
13
|
-
|
14
16
|
1 scenario
|
15
|
-
1
|
16
|
-
|
17
|
+
1 undefined step
|
18
|
+
|
17
19
|
"""
|
18
|
-
|
19
|
-
Scenario:
|
20
|
-
When I run cucumber -q features/sample.feature:
|
20
|
+
|
21
|
+
Scenario: Fail with --strict
|
22
|
+
When I run cucumber -q features/sample.feature:5 --strict
|
21
23
|
Then it should fail with
|
22
24
|
"""
|
25
|
+
@one
|
23
26
|
Feature: Sample
|
24
|
-
Scenario: Failing
|
25
|
-
Given failing
|
26
|
-
FAIL (RuntimeError)
|
27
|
-
./features/step_definitions/sample_steps.rb:5:in `Given /^failing$/'
|
28
|
-
features/sample.feature:12:in `Given failing'
|
29
27
|
|
28
|
+
@two @three
|
29
|
+
Scenario: Missing
|
30
|
+
Given missing
|
30
31
|
|
31
32
|
1 scenario
|
32
|
-
1 step
|
33
|
+
1 undefined step
|
33
34
|
|
34
35
|
"""
|
35
36
|
|
36
|
-
Scenario: Specify 2 line numbers
|
37
|
-
When I run cucumber -q features/sample.feature:
|
37
|
+
Scenario: Specify 2 line numbers where one is a tag
|
38
|
+
When I run cucumber -q features/sample.feature:5:14
|
38
39
|
Then it should fail with
|
39
40
|
"""
|
41
|
+
@one
|
40
42
|
Feature: Sample
|
43
|
+
|
44
|
+
@two @three
|
41
45
|
Scenario: Missing
|
42
46
|
Given missing
|
43
47
|
|
48
|
+
@four
|
44
49
|
Scenario: Failing
|
45
50
|
Given failing
|
46
51
|
FAIL (RuntimeError)
|
47
|
-
./features/step_definitions/sample_steps.rb:
|
48
|
-
features/
|
49
|
-
|
52
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
53
|
+
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
54
|
+
features/sample.feature:16:in `Given failing'
|
50
55
|
|
51
56
|
2 scenarios
|
52
|
-
1 step
|
53
|
-
1
|
57
|
+
1 failed step
|
58
|
+
1 undefined step
|
54
59
|
|
55
60
|
"""
|
56
61
|
|
57
|
-
|
58
62
|
Scenario: Require missing step definition from elsewhere
|
59
|
-
When I run cucumber -q -r ../../features/step_definitions/extra_steps.rb features/sample.feature:
|
63
|
+
When I run cucumber -q -r ../../features/step_definitions/extra_steps.rb features/sample.feature:5
|
60
64
|
Then it should pass with
|
61
65
|
"""
|
66
|
+
@one
|
62
67
|
Feature: Sample
|
68
|
+
|
69
|
+
@two @three
|
63
70
|
Scenario: Missing
|
64
71
|
Given missing
|
65
72
|
|
66
|
-
|
67
|
-
1 scenario
|
68
|
-
1 step passed
|
69
|
-
|
70
|
-
"""
|
71
|
-
|
72
|
-
Scenario: Specify the line number of a blank line
|
73
|
-
When I run cucumber -q features/sample.feature:10
|
74
|
-
Then it should pass with
|
75
|
-
"""
|
76
|
-
Feature: Sample
|
77
|
-
Scenario: Passing
|
78
|
-
Given passing
|
79
|
-
|
80
|
-
|
81
73
|
1 scenario
|
82
|
-
1 step
|
74
|
+
1 passed step
|
83
75
|
|
84
76
|
"""
|
85
77
|
|
86
78
|
Scenario: Specify the line number of a row
|
87
|
-
When I run cucumber -q features/sample.feature:
|
79
|
+
When I run cucumber -q features/sample.feature:12
|
88
80
|
Then it should pass with
|
89
81
|
"""
|
82
|
+
@one
|
90
83
|
Feature: Sample
|
84
|
+
|
85
|
+
@three
|
91
86
|
Scenario: Passing
|
92
87
|
Given passing
|
93
|
-
|
88
|
+
| a | b |
|
89
|
+
| c | d |
|
94
90
|
|
95
91
|
1 scenario
|
96
|
-
1 step
|
92
|
+
1 passed step
|
97
93
|
|
98
94
|
"""
|
99
95
|
|
@@ -101,19 +97,19 @@ Feature: Cucumber command line
|
|
101
97
|
When I run cucumber -q --format progress features/sample.feature
|
102
98
|
Then it should fail with
|
103
99
|
"""
|
104
|
-
|
100
|
+
U.F
|
101
|
+
|
102
|
+
(::) failed steps (::)
|
105
103
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
1
|
114
|
-
|
115
|
-
./features/step_definitions/sample_steps.rb:5:in `Given /^failing$/'
|
116
|
-
features/sample.feature:12:in `Given failing'
|
104
|
+
FAIL (RuntimeError)
|
105
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
106
|
+
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
107
|
+
features/sample.feature:16:in `Given failing'
|
108
|
+
|
109
|
+
3 scenarios
|
110
|
+
1 failed step
|
111
|
+
1 undefined step
|
112
|
+
1 passed step
|
117
113
|
|
118
114
|
"""
|
119
115
|
|
@@ -126,12 +122,14 @@ Feature: Cucumber command line
|
|
126
122
|
For å slippe å gjøre dumme feil
|
127
123
|
Som en regnskapsfører
|
128
124
|
Vil jeg kunne legge sammen
|
125
|
+
|
129
126
|
Scenario: to tall
|
130
127
|
Gitt at jeg har tastet inn 5
|
131
128
|
Og at jeg har tastet inn 7
|
132
129
|
Når jeg summerer
|
133
130
|
Så skal resultatet være 12
|
134
131
|
|
132
|
+
@iterasjon3
|
135
133
|
Scenario: tre tall
|
136
134
|
Gitt at jeg har tastet inn 5
|
137
135
|
Og at jeg har tastet inn 7
|
@@ -139,85 +137,189 @@ Feature: Cucumber command line
|
|
139
137
|
Når jeg summerer
|
140
138
|
Så skal resultatet være 13
|
141
139
|
|
142
|
-
|
143
140
|
2 scenarios
|
144
|
-
9 steps
|
141
|
+
9 passed steps
|
145
142
|
|
146
143
|
"""
|
147
144
|
|
148
145
|
Scenario: --dry-run
|
149
|
-
When I run cucumber --dry-run features
|
146
|
+
When I run cucumber --dry-run --no-snippets features
|
150
147
|
Then it should pass with
|
151
148
|
"""
|
152
|
-
Feature:
|
153
|
-
Scenario Outline: Test state # features/outline_sample.feature:3
|
154
|
-
Given <state> without a table # features/outline_sample.feature:4
|
149
|
+
Feature: Calling undefined step
|
155
150
|
|
156
|
-
|
157
|
-
|
158
|
-
|passing|
|
159
|
-
|failing|
|
151
|
+
Scenario: Call directly
|
152
|
+
Given a step definition that calls an undefined step
|
160
153
|
|
161
|
-
|
154
|
+
Scenario: Call via another
|
155
|
+
Given call step "a step definition that calls an undefined step"
|
162
156
|
|
163
|
-
|
164
|
-
Given missing # other.rb:23
|
157
|
+
Feature: Lots of undefined
|
165
158
|
|
166
|
-
Scenario:
|
167
|
-
Given
|
159
|
+
Scenario: Implement me
|
160
|
+
Given it snows in Sahara
|
161
|
+
Given it's 40 degrees in Norway
|
162
|
+
And it's 40 degrees in Norway
|
163
|
+
When I stop procrastinating
|
164
|
+
And there is world peace
|
168
165
|
|
169
|
-
|
170
|
-
Given failing # features/step_definitions/sample_steps.rb:4
|
166
|
+
Feature: Outline Sample
|
171
167
|
|
168
|
+
Scenario: I have no steps
|
172
169
|
|
173
|
-
|
174
|
-
|
170
|
+
Scenario Outline: Test state
|
171
|
+
Given <state> without a table
|
172
|
+
Given <other_state> without a table
|
173
|
+
|
174
|
+
Examples:
|
175
|
+
| state | other_state |
|
176
|
+
| missing | passing |
|
177
|
+
| passing | passing |
|
178
|
+
| failing | passing |
|
179
|
+
|
180
|
+
@one
|
181
|
+
Feature: Sample
|
182
|
+
|
183
|
+
@two @three
|
184
|
+
Scenario: Missing
|
185
|
+
Given missing
|
186
|
+
|
187
|
+
@three
|
188
|
+
Scenario: Passing
|
189
|
+
Given passing
|
190
|
+
| a | b |
|
191
|
+
| c | d |
|
192
|
+
|
193
|
+
@four
|
194
|
+
Scenario: Failing
|
195
|
+
Given failing
|
196
|
+
|
197
|
+
10 scenarios
|
198
|
+
9 skipped steps
|
199
|
+
7 undefined steps
|
175
200
|
|
176
201
|
"""
|
177
202
|
|
178
203
|
Scenario: Multiple formatters and outputs
|
179
|
-
When I run cucumber --format progress --out tmp/progress.txt --format
|
180
|
-
|
204
|
+
When I run cucumber --format progress --out tmp/progress.txt --format pretty --out tmp/pretty.txt --dry-run features/lots_of_undefined.feature
|
205
|
+
And examples/self_test/tmp/progress.txt should contain
|
181
206
|
"""
|
207
|
+
UUUUU
|
208
|
+
|
209
|
+
1 scenario
|
210
|
+
5 undefined steps
|
211
|
+
|
182
212
|
"""
|
183
|
-
And examples/self_test/tmp/
|
213
|
+
And examples/self_test/tmp/pretty.txt should match
|
184
214
|
"""
|
185
|
-
|
215
|
+
Feature: Lots of undefined
|
186
216
|
|
187
|
-
|
217
|
+
Scenario: Implement me
|
218
|
+
Given it snows in Sahara
|
219
|
+
Given it's 40 degrees in Norway
|
220
|
+
And it's 40 degrees in Norway
|
221
|
+
When I stop procrastinating
|
222
|
+
And there is world peace
|
188
223
|
|
189
|
-
1
|
190
|
-
|
224
|
+
1 scenario
|
225
|
+
5 undefined steps
|
191
226
|
|
227
|
+
"""
|
192
228
|
|
193
|
-
|
229
|
+
Scenario: Run scenario specified by name using --scenario
|
230
|
+
When I run cucumber --scenario Passing -q features
|
231
|
+
Then it should pass with
|
232
|
+
"""
|
233
|
+
@one
|
234
|
+
Feature: Sample
|
194
235
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
236
|
+
@three
|
237
|
+
Scenario: Passing
|
238
|
+
Given passing
|
239
|
+
| a | b |
|
240
|
+
| c | d |
|
199
241
|
|
200
|
-
|
201
|
-
|
202
|
-
./features/step_definitions/sample_steps.rb:5:in `Given /^failing$/'
|
203
|
-
features/sample.feature:12:in `Given failing'
|
242
|
+
1 scenario
|
243
|
+
1 passed step
|
204
244
|
|
205
245
|
"""
|
206
|
-
|
246
|
+
|
247
|
+
Scenario: Run with a tag that exists on 2 scenarios
|
248
|
+
When I run cucumber -q features --tags three
|
249
|
+
Then it should pass with
|
207
250
|
"""
|
208
|
-
|
251
|
+
@one
|
252
|
+
Feature: Sample
|
253
|
+
|
254
|
+
@two @three
|
255
|
+
Scenario: Missing
|
256
|
+
Given missing
|
257
|
+
|
258
|
+
@three
|
259
|
+
Scenario: Passing
|
260
|
+
Given passing
|
261
|
+
| a | b |
|
262
|
+
| c | d |
|
263
|
+
|
264
|
+
2 scenarios
|
265
|
+
1 undefined step
|
266
|
+
1 passed step
|
267
|
+
|
209
268
|
"""
|
210
|
-
|
211
|
-
Scenario: Run
|
212
|
-
When I run cucumber
|
213
|
-
Then it should
|
269
|
+
|
270
|
+
Scenario: Run with a tag that exists on 1 feature
|
271
|
+
When I run cucumber -q features --tags one
|
272
|
+
Then it should fail with
|
214
273
|
"""
|
274
|
+
@one
|
215
275
|
Feature: Sample
|
276
|
+
|
277
|
+
@two @three
|
278
|
+
Scenario: Missing
|
279
|
+
Given missing
|
280
|
+
|
281
|
+
@three
|
216
282
|
Scenario: Passing
|
217
283
|
Given passing
|
284
|
+
| a | b |
|
285
|
+
| c | d |
|
218
286
|
|
287
|
+
@four
|
288
|
+
Scenario: Failing
|
289
|
+
Given failing
|
290
|
+
FAIL (RuntimeError)
|
291
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
292
|
+
./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
|
293
|
+
features/sample.feature:16:in `Given failing'
|
219
294
|
|
220
|
-
|
221
|
-
1 step
|
295
|
+
3 scenarios
|
296
|
+
1 failed step
|
297
|
+
1 undefined step
|
298
|
+
1 passed step
|
299
|
+
|
300
|
+
"""
|
222
301
|
|
302
|
+
Scenario: Reformat files with --autoformat
|
303
|
+
When I run cucumber --autoformat tmp/formatted features
|
304
|
+
Then examples/self_test/tmp/formatted/features/sample.feature should contain
|
223
305
|
"""
|
306
|
+
@one
|
307
|
+
Feature: Sample
|
308
|
+
|
309
|
+
@two @three
|
310
|
+
Scenario: Missing
|
311
|
+
Given missing
|
312
|
+
|
313
|
+
@three
|
314
|
+
Scenario: Passing
|
315
|
+
Given passing
|
316
|
+
| a | b |
|
317
|
+
| c | d |
|
318
|
+
|
319
|
+
@four
|
320
|
+
Scenario: Failing
|
321
|
+
Given failing
|
322
|
+
|
323
|
+
|
324
|
+
"""
|
325
|
+
|
@@ -1,54 +1,56 @@
|
|
1
1
|
Feature: Cucumber command line
|
2
2
|
In order to write better software
|
3
3
|
Developers should be able to execute requirements as tests
|
4
|
-
|
5
|
-
Scenario: Run scenario outline steps only
|
6
|
-
When I run cucumber -q features/outline_sample.feature:3
|
7
|
-
Then it should pass with
|
8
|
-
"""
|
9
|
-
Feature: Outline Sample
|
10
|
-
Scenario Outline: Test state
|
11
|
-
Given <state> without a table
|
12
4
|
|
13
|
-
|
14
|
-
|
15
|
-
1 scenario
|
16
|
-
|
17
|
-
"""
|
18
|
-
|
19
|
-
Scenario: Run single scenario outline table row with missing step definition
|
5
|
+
Scenario: Run scenario outline steps only
|
20
6
|
When I run cucumber -q features/outline_sample.feature:7
|
21
|
-
Then it should
|
7
|
+
Then it should fail with
|
22
8
|
"""
|
23
9
|
Feature: Outline Sample
|
10
|
+
|
24
11
|
Scenario Outline: Test state
|
25
12
|
Given <state> without a table
|
13
|
+
Given <other_state> without a table
|
26
14
|
|
27
|
-
|
28
|
-
|
|
15
|
+
Examples:
|
16
|
+
| state | other_state |
|
17
|
+
| missing | passing |
|
18
|
+
| passing | passing |
|
19
|
+
| failing | passing |
|
20
|
+
FAIL (RuntimeError)
|
21
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
22
|
+
./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
|
23
|
+
features/outline_sample.feature:12:in `Given failing without a table'
|
24
|
+
|
25
|
+
3 scenarios
|
26
|
+
1 failed step
|
27
|
+
2 skipped steps
|
28
|
+
1 undefined step
|
29
|
+
2 passed steps
|
29
30
|
|
30
|
-
2 scenarios
|
31
|
-
1 step pending (1 with no step definition)
|
32
|
-
|
33
31
|
"""
|
34
32
|
|
35
33
|
Scenario: Run single failing scenario outline table row
|
36
|
-
When I run cucumber
|
34
|
+
When I run cucumber features/outline_sample.feature:12
|
37
35
|
Then it should fail with
|
38
36
|
"""
|
39
37
|
Feature: Outline Sample
|
40
|
-
Scenario Outline: Test state
|
41
|
-
Given <state> without a table
|
42
38
|
|
43
|
-
|
44
|
-
|
39
|
+
Scenario Outline: Test state # features/outline_sample.feature:5
|
40
|
+
Given <state> without a table
|
41
|
+
Given <other_state> without a table
|
45
42
|
|
43
|
+
Examples:
|
44
|
+
| state | other_state |
|
45
|
+
| failing | passing |
|
46
46
|
FAIL (RuntimeError)
|
47
|
-
./features/step_definitions/sample_steps.rb:
|
48
|
-
features/
|
47
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
48
|
+
./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
|
49
|
+
features/outline_sample.feature:12:in `Given failing without a table'
|
49
50
|
|
50
|
-
|
51
|
-
1 step
|
51
|
+
1 scenario
|
52
|
+
1 failed step
|
53
|
+
1 skipped step
|
52
54
|
|
53
55
|
"""
|
54
56
|
|
@@ -56,18 +58,24 @@ Feature: Cucumber command line
|
|
56
58
|
When I run cucumber -q --format progress features/outline_sample.feature
|
57
59
|
Then it should fail with
|
58
60
|
"""
|
59
|
-
|
61
|
+
UUS..FS
|
60
62
|
|
61
|
-
|
63
|
+
(::) undefined scenarios (::)
|
62
64
|
|
63
|
-
|
65
|
+
features/outline_sample.feature:3:in `Scenario: I have no steps'
|
64
66
|
|
67
|
+
(::) failed steps (::)
|
65
68
|
|
66
|
-
|
69
|
+
FAIL (RuntimeError)
|
70
|
+
./features/step_definitions/sample_steps.rb:2:in `flunker'
|
71
|
+
./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
|
72
|
+
features/outline_sample.feature:12:in `Given failing without a table'
|
67
73
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
74
|
+
4 scenarios
|
75
|
+
1 failed step
|
76
|
+
2 skipped steps
|
77
|
+
1 undefined step
|
78
|
+
2 passed steps
|
72
79
|
|
73
80
|
"""
|
81
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Feature: Cucumber command line
|
2
|
+
In order to find out what step definitions need to be implemented
|
3
|
+
Developers should always see what step definition is missing
|
4
|
+
|
5
|
+
Scenario: Get info at arbitrary levels of nesting
|
6
|
+
When I run cucumber features/call_undefined_step_from_step_def.feature
|
7
|
+
Then it should pass with
|
8
|
+
"""
|
9
|
+
Feature: Calling undefined step
|
10
|
+
|
11
|
+
Scenario: Call directly # features/call_undefined_step_from_step_def.feature:3
|
12
|
+
Given a step definition that calls an undefined step # features/step_definitions/sample_steps.rb:19
|
13
|
+
Undefined step: "this does not exist" (Cucumber::StepMother::Undefined)
|
14
|
+
./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
|
15
|
+
|
16
|
+
Scenario: Call via another # features/call_undefined_step_from_step_def.feature:6
|
17
|
+
Given call step "a step definition that calls an undefined step" # features/step_definitions/sample_steps.rb:23
|
18
|
+
Undefined step: "this does not exist" (Cucumber::StepMother::Undefined)
|
19
|
+
./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
|
20
|
+
|
21
|
+
2 scenarios
|
22
|
+
2 undefined steps
|
23
|
+
|
24
|
+
You can implement step definitions for missing steps with these snippets:
|
25
|
+
|
26
|
+
Given /^this does not exist$/ do
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
"""
|
31
|
+
|
@@ -6,16 +6,20 @@ When /^I run cucumber (.*)$/ do |cmd|
|
|
6
6
|
@dir ||= 'self_test'
|
7
7
|
full_dir ||= File.expand_path(File.dirname(__FILE__) + "/../../examples/#{@dir}")
|
8
8
|
Dir.chdir(full_dir) do
|
9
|
-
@full_cmd = "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY} #{cmd}"
|
9
|
+
@full_cmd = "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY} --no-color #{cmd}"
|
10
10
|
@out = `#{@full_cmd}`
|
11
11
|
@status = $?.exitstatus
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
Then /^it should (fail|pass) with$/ do |success, output|
|
16
|
+
#puts @out
|
16
17
|
@out.should == output
|
17
|
-
|
18
|
-
|
18
|
+
if success == 'fail'
|
19
|
+
@status.should_not == 0
|
20
|
+
else
|
21
|
+
@status.should == 0
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
Then /^(.*) should contain$/ do |file, text|
|
@@ -1,2 +1,2 @@
|
|
1
1
|
Given /^missing$/ do
|
2
|
-
end
|
2
|
+
end
|
data/features/support/env.rb
CHANGED
data/gem_tasks/features.rake
CHANGED
data/gem_tasks/flog.rake
CHANGED