cucumber 0.6.4 → 0.7.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +11 -0
- data/Rakefile +3 -5
- data/VERSION.yml +3 -3
- data/cucumber.gemspec +35 -55
- data/cucumber.yml +3 -2
- data/examples/i18n/Rakefile +1 -0
- data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +1 -1
- data/examples/i18n/eo/.gitignore +1 -0
- data/examples/i18n/eo/Rakefile +6 -0
- data/examples/i18n/eo/features/adicio.feature +17 -0
- data/examples/i18n/eo/features/divido.feature +10 -0
- data/examples/i18n/eo/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/eo/lib/calculator.rb +14 -0
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +1 -1
- data/examples/i18n/ru/features/division.feature +1 -1
- data/examples/i18n/uk/Rakefile +6 -0
- data/examples/i18n/uk/features/addition.feature +11 -0
- data/examples/i18n/uk/features/consecutive_calculations.feature +17 -0
- data/examples/i18n/uk/features/division.feature +16 -0
- data/examples/i18n/uk/features/step_definitons/calculator_steps.rb +19 -0
- data/examples/i18n/uk/features/support/env.rb +5 -0
- data/examples/i18n/uk/features/support/world.rb +8 -0
- data/examples/i18n/uk/lib/calculator.rb +24 -0
- data/examples/i18n/uz/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/sinatra/features/add.feature +1 -1
- data/examples/sinatra/features/step_definitions/add_steps.rb +1 -1
- data/examples/sinatra/features/support/env.rb +2 -19
- data/examples/sinatra/views/add.erb +7 -5
- data/features/announce.feature +46 -39
- data/features/background.feature +3 -0
- data/features/call_many_steps.feature +1 -1
- data/features/cucumber_cli_outlines.feature +12 -0
- data/features/drb_server_integration.feature +1 -1
- data/features/exception_in_after_block.feature +3 -0
- data/features/exception_in_after_step_block.feature +3 -0
- data/features/html_formatter/a.html +29 -29
- data/features/language_help.feature +57 -52
- data/features/multiline_names.feature +1 -0
- data/features/step_definitions/cucumber_steps.rb +2 -1
- data/features/usage_and_stepdefs_formatter.feature +30 -30
- data/features/wire_protocol.feature +12 -9
- data/features/wire_protocol_table_diffing.feature +8 -6
- data/features/wire_protocol_timeouts.feature +5 -4
- data/gem_tasks/treetop.rake +13 -0
- data/lib/autotest/cucumber_mixin.rb +1 -1
- data/lib/cucumber/ast.rb +1 -0
- data/lib/cucumber/ast/background.rb +14 -4
- data/lib/cucumber/ast/examples.rb +2 -0
- data/lib/cucumber/ast/feature.rb +26 -5
- data/lib/cucumber/ast/feature_element.rb +18 -9
- data/lib/cucumber/ast/outline_table.rb +13 -1
- data/lib/cucumber/ast/py_string.rb +26 -9
- data/lib/cucumber/ast/scenario.rb +13 -7
- data/lib/cucumber/ast/scenario_outline.rb +18 -6
- data/lib/cucumber/ast/step.rb +4 -4
- data/lib/cucumber/ast/step_invocation.rb +5 -2
- data/lib/cucumber/ast/table.rb +26 -1
- data/lib/cucumber/ast/tags.rb +3 -1
- data/lib/cucumber/ast/tree_walker.rb +2 -18
- data/lib/cucumber/cli/configuration.rb +2 -2
- data/lib/cucumber/cli/options.rb +16 -21
- data/lib/cucumber/feature_file.rb +25 -7
- data/lib/cucumber/formatter/ansicolor.rb +6 -1
- data/lib/cucumber/formatter/console.rb +4 -3
- data/lib/cucumber/formatter/html.rb +8 -5
- data/lib/cucumber/formatter/junit.rb +5 -4
- data/lib/cucumber/formatter/pdf.rb +2 -3
- data/lib/cucumber/formatter/pretty.rb +5 -5
- data/lib/cucumber/formatter/usage.rb +2 -2
- data/lib/cucumber/parser.rb +0 -6
- data/lib/cucumber/parser/gherkin_builder.rb +142 -0
- data/lib/cucumber/platform.rb +0 -2
- data/lib/cucumber/rb_support/rb_language.rb +7 -12
- data/lib/cucumber/step_mother.rb +4 -26
- data/spec/cucumber/ast/background_spec.rb +0 -1
- data/spec/cucumber/ast/feature_factory.rb +2 -4
- data/spec/cucumber/ast/feature_spec.rb +0 -2
- data/spec/cucumber/ast/py_string_spec.rb +2 -13
- data/spec/cucumber/ast/scenario_outline_spec.rb +0 -1
- data/spec/cucumber/ast/scenario_spec.rb +0 -1
- data/spec/cucumber/ast/step_spec.rb +1 -1
- data/spec/cucumber/ast/table_spec.rb +2 -2
- data/spec/cucumber/cli/main_spec.rb +1 -1
- data/spec/cucumber/cli/options_spec.rb +2 -2
- data/spec/cucumber/formatter/html_spec.rb +20 -1
- data/spec/cucumber/formatter/junit_spec.rb +1 -0
- data/spec/cucumber/formatter/spec_helper.rb +7 -5
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +0 -1
- data/spec/cucumber/step_mother_spec.rb +2 -2
- data/spec/spec_helper.rb +0 -1
- metadata +67 -93
- data/lib/cucumber/cli/language_help_formatter.rb +0 -72
- data/lib/cucumber/filter.rb +0 -43
- data/lib/cucumber/languages.yml +0 -536
- data/lib/cucumber/parser/common.rb +0 -182
- data/lib/cucumber/parser/common.tt +0 -21
- data/lib/cucumber/parser/feature.rb +0 -1591
- data/lib/cucumber/parser/feature.tt +0 -287
- data/lib/cucumber/parser/i18n.tt +0 -35
- data/lib/cucumber/parser/natural_language.rb +0 -118
- data/lib/cucumber/parser/py_string.rb +0 -285
- data/lib/cucumber/parser/py_string.tt +0 -45
- data/lib/cucumber/parser/table.rb +0 -314
- data/lib/cucumber/parser/table.tt +0 -60
- data/lib/cucumber/parser/treetop_ext.rb +0 -54
- data/lib/cucumber/tag_expression.rb +0 -41
- data/spec/cucumber/ast/feature_element_spec.rb +0 -41
- data/spec/cucumber/ast/step_collection_spec.rb +0 -17
- data/spec/cucumber/parser/feature_parser_spec.rb +0 -400
- data/spec/cucumber/parser/table_parser_spec.rb +0 -52
- data/spec/cucumber/tag_expression_spec.rb +0 -125
- data/spec/cucumber/treetop_parser/empty_feature.feature +0 -4
- data/spec/cucumber/treetop_parser/empty_scenario.feature +0 -9
- data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +0 -3
- data/spec/cucumber/treetop_parser/fit_scenario.feature +0 -8
- data/spec/cucumber/treetop_parser/given_scenario.feature +0 -9
- data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +0 -7
- data/spec/cucumber/treetop_parser/multiline_steps.feature +0 -17
- data/spec/cucumber/treetop_parser/multiple_tables.feature +0 -27
- data/spec/cucumber/treetop_parser/scenario_outline.feature +0 -16
- data/spec/cucumber/treetop_parser/spaces.feature +0 -12
- data/spec/cucumber/treetop_parser/test_dos.feature +0 -25
- data/spec/cucumber/treetop_parser/with_comments.feature +0 -23
- data/spec/cucumber/treetop_parser/with_tags.feature +0 -18
@@ -7,63 +7,68 @@ Feature: Language help
|
|
7
7
|
When I run cucumber --i18n pt help
|
8
8
|
Then it should pass with
|
9
9
|
"""
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
10
|
+
| feature | "Funcionalidade" |
|
11
|
+
| background | "Contexto" |
|
12
|
+
| scenario | "Cenário", "Cenario" |
|
13
|
+
| scenario_outline | "Esquema do Cenário", "Esquema do Cenario" |
|
14
|
+
| examples | "Exemplos" |
|
15
|
+
| given | "* ", "Dado " |
|
16
|
+
| when | "* ", "Quando " |
|
17
|
+
| then | "* ", "Então ", "Entao " |
|
18
|
+
| and | "* ", "E " |
|
19
|
+
| but | "* ", "Mas " |
|
20
|
+
| given (code) | "Dado" |
|
21
|
+
| when (code) | "Quando" |
|
22
|
+
| then (code) | "Então", "Entao" |
|
22
23
|
|
23
24
|
"""
|
24
25
|
Scenario: List languages
|
25
26
|
When I run cucumber --i18n help
|
27
|
+
Then STDERR should be empty
|
26
28
|
Then it should pass with
|
27
29
|
"""
|
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
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
30
|
+
| ar | Arabic | العربية |
|
31
|
+
| bg | Bulgarian | български |
|
32
|
+
| ca | Catalan | català |
|
33
|
+
| cs | Czech | Česky |
|
34
|
+
| cy-GB | Welsh | Cymraeg |
|
35
|
+
| da | Danish | dansk |
|
36
|
+
| de | German | Deutsch |
|
37
|
+
| en | English | English |
|
38
|
+
| en-Scouse | Scouse | Scouse |
|
39
|
+
| en-au | Australian | Australian |
|
40
|
+
| en-lol | LOLCAT | LOLCAT |
|
41
|
+
| en-tx | Texan | Texan |
|
42
|
+
| eo | Esperanto | Esperanto |
|
43
|
+
| es | Spanish | español |
|
44
|
+
| et | Estonian | eesti keel |
|
45
|
+
| fi | Finnish | suomi |
|
46
|
+
| fr | French | français |
|
47
|
+
| he | Hebrew | עברית |
|
48
|
+
| hr | Croatian | hrvatski |
|
49
|
+
| hu | Hungarian | magyar |
|
50
|
+
| id | Indonesian | Bahasa Indonesia |
|
51
|
+
| it | Italian | italiano |
|
52
|
+
| ja | Japanese | 日本語 |
|
53
|
+
| ko | Korean | 한국어 |
|
54
|
+
| lt | Lithuanian | lietuvių kalba |
|
55
|
+
| lv | Latvian | latviešu |
|
56
|
+
| nl | Dutch | Nederlands |
|
57
|
+
| no | Norwegian | norsk |
|
58
|
+
| pl | Polish | polski |
|
59
|
+
| pt | Portuguese | português |
|
60
|
+
| ro | Romanian | română |
|
61
|
+
| ro-RO | Romanian (diacritical) | română (diacritical) |
|
62
|
+
| ru | Russian | русский |
|
63
|
+
| sk | Slovak | Slovensky |
|
64
|
+
| sr-Cyrl | Serbian | Српски |
|
65
|
+
| sr-Latn | Serbian (Latin) | Srpski (Latinica) |
|
66
|
+
| sv | Swedish | Svenska |
|
67
|
+
| tr | Turkish | Türkçe |
|
68
|
+
| uk | Ukrainian | Українська |
|
69
|
+
| uz | Uzbek | Узбекча |
|
70
|
+
| vi | Vietnamese | Tiếng Việt |
|
71
|
+
| zh-CN | Chinese simplified | 简体中文 |
|
72
|
+
| zh-TW | Chinese traditional | 繁體中文 |
|
68
73
|
|
69
74
|
"""
|
@@ -8,6 +8,7 @@ end
|
|
8
8
|
Given /^a standard Cucumber project directory structure$/ do
|
9
9
|
@current_dir = working_dir
|
10
10
|
in_current_dir do
|
11
|
+
FileUtils.rm_rf 'features' if File.directory?('features')
|
11
12
|
FileUtils.mkdir_p 'features/support'
|
12
13
|
FileUtils.mkdir 'features/step_definitions'
|
13
14
|
end
|
@@ -49,7 +50,7 @@ Given /^I have environment variable (\w+) set to "([^\"]*)"$/ do |variable, valu
|
|
49
50
|
end
|
50
51
|
|
51
52
|
When /^I run cucumber (.*)$/ do |cucumber_opts|
|
52
|
-
run "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY} --no-color #{cucumber_opts} CUCUMBER_OUTPUT_ENCODING=UTF-8"
|
53
|
+
run "#{Cucumber::RUBY_BINARY} -r rubygems #{Cucumber::BINARY} --no-color #{cucumber_opts} CUCUMBER_OUTPUT_ENCODING=UTF-8"
|
53
54
|
end
|
54
55
|
|
55
56
|
When /^I run rake (.*)$/ do |rake_opts|
|
@@ -136,34 +136,34 @@ Feature: Cucumber command line
|
|
136
136
|
|
137
137
|
"""
|
138
138
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
139
|
+
Scenario: --format stepdefs
|
140
|
+
When I run cucumber features --format stepdefs --dry-run
|
141
|
+
Then STDERR should be empty
|
142
|
+
And it should pass with
|
143
|
+
"""
|
144
|
+
-------------------------------------UU-U--------------UUUUU---------U-------U--------------U-UU-------------------------------------------------UU
|
145
|
+
|
146
|
+
/^'(.+)' cukes$/ # features/step_definitions/sample_steps.rb:27
|
147
|
+
/^'(.+)' global cukes$/ # features/step_definitions/sample_steps.rb:35
|
148
|
+
/^I should have '(.+)' cukes$/ # features/step_definitions/sample_steps.rb:31
|
149
|
+
/^I should have '(.+)' global cukes$/ # features/step_definitions/sample_steps.rb:42
|
150
|
+
/^a step definition that calls an undefined step$/ # features/step_definitions/sample_steps.rb:19
|
151
|
+
/^another unused$/ # features/step_definitions/sample_steps.rb:69
|
152
|
+
NOT MATCHED BY ANY STEPS
|
153
|
+
/^call step "(.*)"$/ # features/step_definitions/sample_steps.rb:23
|
154
|
+
/^failing expectation$/ # features/step_definitions/sample_steps.rb:62
|
155
|
+
/^failing without a table$/ # features/step_definitions/sample_steps.rb:15
|
156
|
+
/^failing$/ # features/step_definitions/sample_steps.rb:8
|
157
|
+
/^multiline string$/ # features/step_definitions/sample_steps.rb:50
|
158
|
+
/^passing without a table$/ # features/step_definitions/sample_steps.rb:12
|
159
|
+
/^passing$/ # features/step_definitions/sample_steps.rb:5
|
160
|
+
/^table$/ # features/step_definitions/sample_steps.rb:46
|
161
|
+
/^the multiline string should be$/ # features/step_definitions/sample_steps.rb:58
|
162
|
+
/^the table should be$/ # features/step_definitions/sample_steps.rb:54
|
163
|
+
/^unused$/ # features/step_definitions/sample_steps.rb:66
|
164
|
+
NOT MATCHED BY ANY STEPS
|
165
|
+
|
166
|
+
43 scenarios (32 skipped, 10 undefined, 1 passed)
|
167
|
+
131 steps (117 skipped, 14 undefined)
|
168
168
|
|
169
|
-
|
169
|
+
"""
|
@@ -41,6 +41,7 @@ Feature: Wire Protocol
|
|
41
41
|
Given a standard Cucumber project directory structure
|
42
42
|
And a file named "features/wired.feature" with:
|
43
43
|
"""
|
44
|
+
Feature: High strung
|
44
45
|
Scenario: Wired
|
45
46
|
Given we're all wired
|
46
47
|
|
@@ -108,7 +109,7 @@ Feature: Wire Protocol
|
|
108
109
|
"""
|
109
110
|
-
|
110
111
|
|
111
|
-
we.*
|
112
|
+
we.* # MyApp.MyClass:123
|
112
113
|
|
113
114
|
1 scenario (1 skipped)
|
114
115
|
1 step (1 skipped)
|
@@ -147,12 +148,12 @@ Feature: Wire Protocol
|
|
147
148
|
When I run cucumber -f pretty -q
|
148
149
|
And it should pass with
|
149
150
|
"""
|
150
|
-
|
151
|
+
Feature: High strung
|
151
152
|
|
152
153
|
Scenario: Wired
|
153
154
|
Given we're all wired
|
154
155
|
I'll do it later (Cucumber::Pending)
|
155
|
-
features/wired.feature:
|
156
|
+
features/wired.feature:3:in `Given we're all wired'
|
156
157
|
|
157
158
|
1 scenario (1 pending)
|
158
159
|
1 step (1 pending)
|
@@ -207,10 +208,10 @@ Feature: Wire Protocol
|
|
207
208
|
(::) failed steps (::)
|
208
209
|
|
209
210
|
The wires are down (Some.Foreign.ExceptionType from localhost:54321)
|
210
|
-
features/wired.feature:
|
211
|
+
features/wired.feature:3:in `Given we're all wired'
|
211
212
|
|
212
213
|
Failing Scenarios:
|
213
|
-
cucumber features/wired.feature:
|
214
|
+
cucumber features/wired.feature:2 # Scenario: Wired
|
214
215
|
|
215
216
|
1 scenario (1 failed)
|
216
217
|
1 step (1 failed)
|
@@ -261,6 +262,7 @@ Feature: Wire Protocol
|
|
261
262
|
Scenario: Invoke a step definition which takes table arguments (and passes)
|
262
263
|
Given a file named "features/wired_on_tables.feature" with:
|
263
264
|
"""
|
265
|
+
Feature: High strung
|
264
266
|
Scenario: Wired and more
|
265
267
|
Given we're all:
|
266
268
|
| wired |
|
@@ -292,16 +294,17 @@ Feature: Wire Protocol
|
|
292
294
|
Given there is a wire server running on port 54321 which understands the following protocol:
|
293
295
|
| request | response |
|
294
296
|
| ["step_matches",{"name_to_match":"we're all wired"}] | ["success",[]] |
|
295
|
-
| ["snippet_text",{"step_keyword":"Given","multiline_arg_class":"","step_name":"we're all wired"}] | ["success","foo()\n bar;\nbaz"] |
|
297
|
+
| ["snippet_text",{"step_keyword":"Given ","multiline_arg_class":"","step_name":"we're all wired"}] | ["success","foo()\n bar;\nbaz"] |
|
296
298
|
| ["begin_scenario"] | ["success"] |
|
297
299
|
| ["end_scenario"] | ["success"] |
|
298
300
|
When I run cucumber -f pretty
|
301
|
+
Then STDERR should be empty
|
299
302
|
And it should pass with
|
300
303
|
"""
|
304
|
+
Feature: High strung
|
301
305
|
|
302
|
-
|
303
|
-
|
304
|
-
Given we're all wired # features/wired.feature:2
|
306
|
+
Scenario: Wired # features/wired.feature:2
|
307
|
+
Given we're all wired # features/wired.feature:3
|
305
308
|
|
306
309
|
1 scenario (1 undefined)
|
307
310
|
1 step (1 undefined)
|
@@ -8,6 +8,7 @@ Feature: Wire protocol table diffing
|
|
8
8
|
Given a standard Cucumber project directory structure
|
9
9
|
And a file named "features/wired.feature" with:
|
10
10
|
"""
|
11
|
+
Feature: Hello
|
11
12
|
Scenario: Wired
|
12
13
|
Given we're all wired
|
13
14
|
|
@@ -28,6 +29,7 @@ Feature: Wire protocol table diffing
|
|
28
29
|
| ["diff_failed"] | ["fail",{"message":"Not same", "exception":"DifferentException", "backtrace":["a.cs:12","b.cs:34"]}] |
|
29
30
|
| ["end_scenario"] | ["success"] |
|
30
31
|
When I run cucumber -f progress --backtrace
|
32
|
+
Then STDERR should be empty
|
31
33
|
And it should fail with
|
32
34
|
"""
|
33
35
|
F
|
@@ -37,10 +39,10 @@ Feature: Wire protocol table diffing
|
|
37
39
|
Not same (DifferentException from localhost:54321)
|
38
40
|
a.cs:12
|
39
41
|
b.cs:34
|
40
|
-
features/wired.feature:
|
42
|
+
features/wired.feature:3:in `Given we're all wired'
|
41
43
|
|
42
44
|
Failing Scenarios:
|
43
|
-
cucumber features/wired.feature:
|
45
|
+
cucumber features/wired.feature:2 # Scenario: Wired
|
44
46
|
|
45
47
|
1 scenario (1 failed)
|
46
48
|
1 step (1 failed)
|
@@ -81,10 +83,10 @@ Feature: Wire protocol table diffing
|
|
81
83
|
(::) failed steps (::)
|
82
84
|
|
83
85
|
I wanted things to be different for us (Cucumber::WireSupport::WireException)
|
84
|
-
features/wired.feature:
|
86
|
+
features/wired.feature:3:in `Given we're all wired'
|
85
87
|
|
86
88
|
Failing Scenarios:
|
87
|
-
cucumber features/wired.feature:
|
89
|
+
cucumber features/wired.feature:2 # Scenario: Wired
|
88
90
|
|
89
91
|
1 scenario (1 failed)
|
90
92
|
1 step (1 failed)
|
@@ -106,10 +108,10 @@ Feature: Wire protocol table diffing
|
|
106
108
|
(::) failed steps (::)
|
107
109
|
|
108
110
|
Tables were not identical (Cucumber::Ast::Table::Different)
|
109
|
-
features/wired.feature:
|
111
|
+
features/wired.feature:3:in `Given we're all wired'
|
110
112
|
|
111
113
|
Failing Scenarios:
|
112
|
-
cucumber features/wired.feature:
|
114
|
+
cucumber features/wired.feature:2 # Scenario: Wired
|
113
115
|
|
114
116
|
1 scenario (1 failed)
|
115
117
|
1 step (1 failed)
|
@@ -8,6 +8,7 @@ Feature: Wire protocol timeouts
|
|
8
8
|
Given a standard Cucumber project directory structure
|
9
9
|
And a file named "features/wired.feature" with:
|
10
10
|
"""
|
11
|
+
Feature: Telegraphy
|
11
12
|
Scenario: Wired
|
12
13
|
Given we're all wired
|
13
14
|
|
@@ -46,15 +47,15 @@ Feature: Wire protocol timeouts
|
|
46
47
|
Then STDERR should be empty
|
47
48
|
And it should fail with
|
48
49
|
"""
|
50
|
+
Feature: Telegraphy
|
49
51
|
|
50
|
-
|
51
|
-
Scenario: Wired # features/wired.feature:1
|
52
|
+
Scenario: Wired # features/wired.feature:2
|
52
53
|
Given we're all wired # Unknown
|
53
54
|
Timed out calling wire server with message 'invoke' (Timeout::Error)
|
54
|
-
features/wired.feature:
|
55
|
+
features/wired.feature:3:in `Given we're all wired'
|
55
56
|
|
56
57
|
Failing Scenarios:
|
57
|
-
cucumber features/wired.feature:
|
58
|
+
cucumber features/wired.feature:2 # Scenario: Wired
|
58
59
|
|
59
60
|
1 scenario (1 failed)
|
60
61
|
1 step (1 failed)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
namespace :tt do
|
2
|
+
files = %w{lib/cucumber/parser/common.tt lib/cucumber/parser/feature.tt lib/cucumber/parser/py_string.tt lib/cucumber/parser/table.tt}
|
3
|
+
|
4
|
+
desc 'Compile .tt files'
|
5
|
+
task :compile do
|
6
|
+
files.each {|tt| sh("tt #{tt}") }
|
7
|
+
end
|
8
|
+
|
9
|
+
desc 'Remove compiled .tt files'
|
10
|
+
task :rm do
|
11
|
+
rm_rf files.map{|tt| tt.gsub(/\.tt$/, '.rb')}
|
12
|
+
end
|
13
|
+
end
|
@@ -117,7 +117,7 @@ module Autotest::CucumberMixin
|
|
117
117
|
end
|
118
118
|
# No --color option as some IDEs (Netbeans) don't output them very well ([31m1 failed step[0m)
|
119
119
|
args += %w{--format rerun --out} << dirty_features_filename
|
120
|
-
args << (features_to_run == :all ? "
|
120
|
+
args << (features_to_run == :all ? "" : features_to_run)
|
121
121
|
|
122
122
|
# Unless I do this, all the steps turn up undefined during the rerun...
|
123
123
|
unless features_to_run == :all
|
data/lib/cucumber/ast.rb
CHANGED
@@ -8,6 +8,7 @@ require 'cucumber/ast/step_invocation'
|
|
8
8
|
require 'cucumber/ast/step_collection'
|
9
9
|
require 'cucumber/ast/step'
|
10
10
|
require 'cucumber/ast/table'
|
11
|
+
require 'cucumber/ast/tags'
|
11
12
|
require 'cucumber/ast/py_string'
|
12
13
|
require 'cucumber/ast/outline_table'
|
13
14
|
require 'cucumber/ast/examples'
|
@@ -6,14 +6,20 @@ module Cucumber
|
|
6
6
|
include FeatureElement
|
7
7
|
attr_reader :feature_elements
|
8
8
|
|
9
|
-
def initialize(comment, line, keyword, name,
|
10
|
-
@comment, @line, @keyword, @name, @
|
11
|
-
attach_steps(steps)
|
12
|
-
@step_invocations = @steps.step_invocations(true)
|
9
|
+
def initialize(comment, line, keyword, name, raw_steps)
|
10
|
+
@comment, @line, @keyword, @name, @raw_steps = comment, line, keyword, name, raw_steps
|
13
11
|
@feature_elements = []
|
14
12
|
end
|
15
13
|
|
14
|
+
def init
|
15
|
+
return if @steps
|
16
|
+
attach_steps(@raw_steps)
|
17
|
+
@steps = StepCollection.new(@raw_steps)
|
18
|
+
@step_invocations = @steps.step_invocations(true)
|
19
|
+
end
|
20
|
+
|
16
21
|
def step_collection(step_invocations)
|
22
|
+
init
|
17
23
|
unless(@first_collection_created)
|
18
24
|
@first_collection_created = true
|
19
25
|
@step_invocations.dup(step_invocations)
|
@@ -24,6 +30,7 @@ module Cucumber
|
|
24
30
|
|
25
31
|
def accept(visitor)
|
26
32
|
return if Cucumber.wants_to_quit
|
33
|
+
init
|
27
34
|
visitor.visit_comment(@comment) unless @comment.empty?
|
28
35
|
visitor.visit_background_name(@keyword, @name, file_colon_line(@line), source_indent(first_line_length))
|
29
36
|
with_visitor(hook_context, visitor) do
|
@@ -35,6 +42,7 @@ module Cucumber
|
|
35
42
|
end
|
36
43
|
|
37
44
|
def with_visitor(scenario, visitor)
|
45
|
+
init
|
38
46
|
if self != scenario && scenario.respond_to?(:with_visitor)
|
39
47
|
scenario.with_visitor(visitor) do
|
40
48
|
yield
|
@@ -45,6 +53,7 @@ module Cucumber
|
|
45
53
|
end
|
46
54
|
|
47
55
|
def accept_hook?(hook)
|
56
|
+
init
|
48
57
|
if hook_context != self
|
49
58
|
hook_context.accept_hook?(hook)
|
50
59
|
else
|
@@ -62,6 +71,7 @@ module Cucumber
|
|
62
71
|
end
|
63
72
|
|
64
73
|
def to_sexp
|
74
|
+
init
|
65
75
|
sexp = [:background, @line, @keyword]
|
66
76
|
sexp += [@name] unless @name.empty?
|
67
77
|
comment = @comment.to_sexp
|