cucumber 2.0.0.beta.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/History.md +131 -32
- data/Rakefile +0 -2
- data/cucumber.gemspec +4 -3
- data/examples/i18n/ht/Rakefile +6 -0
- data/examples/i18n/ht/features/adisyon.feature +17 -0
- data/examples/i18n/ht/features/divizyon.feature +10 -0
- data/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb +25 -0
- data/examples/i18n/ht/lib/kalkilatris.rb +14 -0
- data/examples/tcl/features/step_definitions/fib_steps.rb +1 -1
- data/features/docs/cli/dry_run.feature +48 -0
- data/features/docs/cli/exclude_files.feature +1 -2
- data/features/docs/cli/run_specific_scenarios.feature +28 -66
- data/features/docs/cli/strict_mode.feature +24 -1
- data/features/docs/defining_steps/nested_steps.feature +49 -0
- data/features/docs/defining_steps/skip_scenario.feature +31 -2
- data/features/docs/defining_steps/snippets.feature +15 -0
- data/features/docs/exception_in_after_step_hook.feature +1 -1
- data/features/docs/exception_in_around_hook.feature +80 -0
- data/features/docs/extending_cucumber/custom_filter.feature +29 -0
- data/features/docs/extending_cucumber/custom_formatter.feature +65 -7
- data/features/docs/formatters/debug_formatter.feature +24 -17
- data/features/docs/formatters/json_formatter.feature +65 -1
- data/features/docs/formatters/junit_formatter.feature +40 -0
- data/features/docs/formatters/pretty_formatter.feature +42 -0
- data/features/docs/formatters/rerun_formatter.feature +3 -2
- data/features/docs/getting_started.feature +1 -1
- data/features/docs/{wire_protocol_erb.feature → wire_protocol/erb_configuration.feature} +2 -2
- data/features/docs/wire_protocol/handle_unexpected_response.feature +30 -0
- data/features/docs/wire_protocol/invoke_message.feature +216 -0
- data/features/docs/wire_protocol/readme.md +26 -0
- data/features/docs/wire_protocol/snippets_message.feature +51 -0
- data/features/docs/wire_protocol/step_matches_message.feature +81 -0
- data/features/docs/{wire_protocol_table_diffing.feature → wire_protocol/table_diffing.feature} +1 -0
- data/features/docs/{wire_protocol_tags.feature → wire_protocol/tags.feature} +1 -0
- data/features/docs/{wire_protocol_timeouts.feature → wire_protocol/timeouts.feature} +1 -0
- data/features/docs/work_in_progress.feature +1 -1
- data/features/docs/writing_support_code/after_hooks.feature +24 -0
- data/features/docs/writing_support_code/around_hooks.feature +31 -0
- data/features/docs/writing_support_code/before_hook.feature +7 -3
- data/features/docs/writing_support_code/tagged_hooks.feature +44 -6
- data/features/lib/step_definitions/wire_steps.rb +18 -1
- data/features/lib/support/fake_wire_server.rb +10 -7
- data/lib/cucumber/cli/configuration.rb +6 -11
- data/lib/cucumber/cli/main.rb +2 -2
- data/lib/cucumber/cli/options.rb +8 -1
- data/lib/cucumber/cli/profile_loader.rb +1 -1
- data/lib/cucumber/core_ext/instance_exec.rb +1 -1
- data/lib/cucumber/encoding.rb +5 -0
- data/lib/cucumber/errors.rb +8 -0
- data/lib/cucumber/file_specs.rb +3 -1
- data/lib/cucumber/filters/activate_steps.rb +33 -0
- data/lib/cucumber/filters/apply_after_hooks.rb +9 -0
- data/lib/cucumber/filters/apply_after_step_hooks.rb +12 -0
- data/lib/cucumber/filters/apply_around_hooks.rb +12 -0
- data/lib/cucumber/filters/apply_before_hooks.rb +9 -0
- data/lib/cucumber/{runtime → filters}/gated_receiver.rb +5 -1
- data/lib/cucumber/filters/prepare_world.rb +45 -0
- data/lib/cucumber/filters/quit.rb +28 -0
- data/lib/cucumber/filters/randomizer.rb +40 -0
- data/lib/cucumber/{runtime → filters}/tag_limits/test_case_index.rb +4 -2
- data/lib/cucumber/{runtime → filters}/tag_limits/verifier.rb +4 -2
- data/lib/cucumber/filters/tag_limits.rb +45 -0
- data/lib/cucumber/filters.rb +9 -0
- data/lib/cucumber/formatter/ansicolor.rb +0 -8
- data/lib/cucumber/formatter/console.rb +37 -20
- data/lib/cucumber/formatter/debug.rb +1 -8
- data/lib/cucumber/formatter/fanout.rb +27 -0
- data/lib/cucumber/formatter/gherkin_formatter_adapter.rb +10 -9
- data/lib/cucumber/formatter/html.rb +31 -6
- data/lib/cucumber/formatter/ignore_missing_messages.rb +20 -0
- data/lib/cucumber/formatter/junit.rb +97 -2
- data/lib/cucumber/formatter/legacy_api/adapter.rb +1060 -0
- data/lib/cucumber/formatter/legacy_api/ast.rb +376 -0
- data/lib/cucumber/formatter/legacy_api/results.rb +51 -0
- data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +30 -0
- data/lib/cucumber/formatter/pretty.rb +14 -0
- data/lib/cucumber/formatter/progress.rb +10 -0
- data/lib/cucumber/formatter/rerun.rb +14 -88
- data/lib/cucumber/hooks.rb +97 -0
- data/lib/cucumber/language_support/language_methods.rb +0 -54
- data/lib/cucumber/multiline_argument/data_table.rb +41 -29
- data/lib/cucumber/platform.rb +3 -3
- data/lib/cucumber/project_initializer.rb +43 -0
- data/lib/cucumber/rb_support/rb_hook.rb +2 -2
- data/lib/cucumber/rb_support/rb_step_definition.rb +11 -2
- data/lib/cucumber/rb_support/rb_transform.rb +3 -1
- data/lib/cucumber/rb_support/rb_world.rb +2 -2
- data/lib/cucumber/rb_support/snippet.rb +1 -1
- data/lib/cucumber/rspec/doubles.rb +1 -1
- data/lib/cucumber/running_test_case.rb +115 -0
- data/lib/cucumber/runtime/after_hooks.rb +24 -0
- data/lib/cucumber/runtime/before_hooks.rb +23 -0
- data/lib/cucumber/runtime/for_programming_languages.rb +4 -8
- data/lib/cucumber/runtime/step_hooks.rb +22 -0
- data/lib/cucumber/runtime/support_code.rb +70 -5
- data/lib/cucumber/runtime.rb +56 -112
- data/lib/cucumber/step_match.rb +26 -2
- data/lib/cucumber.rb +7 -3
- data/spec/cucumber/cli/configuration_spec.rb +16 -1
- data/spec/cucumber/cli/profile_loader_spec.rb +10 -0
- data/spec/cucumber/core_ext/instance_exec_spec.rb +4 -0
- data/spec/cucumber/file_specs_spec.rb +21 -2
- data/spec/cucumber/filters/activate_steps_spec.rb +57 -0
- data/spec/cucumber/{runtime → filters}/gated_receiver_spec.rb +3 -3
- data/spec/cucumber/{runtime → filters}/tag_limits/test_case_index_spec.rb +3 -3
- data/spec/cucumber/{runtime → filters}/tag_limits/verifier_spec.rb +4 -4
- data/spec/cucumber/{runtime/tag_limits/filter_spec.rb → filters/tag_limits_spec.rb} +6 -6
- data/spec/cucumber/formatter/debug_spec.rb +25 -530
- data/spec/cucumber/formatter/html_spec.rb +140 -0
- data/spec/cucumber/formatter/junit_spec.rb +212 -156
- data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +2090 -0
- data/spec/cucumber/formatter/pretty_spec.rb +248 -2
- data/spec/cucumber/formatter/rerun_spec.rb +107 -0
- data/spec/cucumber/formatter/spec_helper.rb +17 -8
- data/spec/cucumber/hooks_spec.rb +30 -0
- data/spec/cucumber/multiline_argument/data_table_spec.rb +53 -47
- data/spec/cucumber/project_initializer_spec.rb +87 -0
- data/spec/cucumber/rb_support/rb_language_spec.rb +2 -2
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +32 -7
- data/spec/cucumber/rb_support/rb_transform_spec.rb +20 -0
- data/spec/cucumber/rb_support/snippet_spec.rb +6 -6
- data/spec/cucumber/running_test_case_spec.rb +83 -0
- data/spec/cucumber/runtime_spec.rb +1 -5
- data/spec/spec_helper.rb +3 -4
- metadata +149 -107
- data/bin/cuke +0 -60
- data/features/docs/extending_cucumber/formatter_callbacks.feature +0 -370
- data/features/docs/output_from_hooks.feature +0 -128
- data/features/docs/report_called_undefined_steps.feature +0 -57
- data/features/docs/wire_protocol.feature +0 -337
- data/gem_tasks/yard/default/layout/html/bubble_32x32.png +0 -0
- data/gem_tasks/yard/default/layout/html/footer.erb +0 -5
- data/gem_tasks/yard/default/layout/html/index.erb +0 -1
- data/gem_tasks/yard/default/layout/html/layout.erb +0 -25
- data/gem_tasks/yard/default/layout/html/logo.erb +0 -1
- data/gem_tasks/yard/default/layout/html/setup.rb +0 -4
- data/gem_tasks/yard.rake +0 -43
- data/lib/cucumber/mappings.rb +0 -238
- data/lib/cucumber/reports/legacy_formatter.rb +0 -1349
- data/lib/cucumber/runtime/results.rb +0 -64
- data/lib/cucumber/runtime/tag_limits/filter.rb +0 -31
- data/lib/cucumber/runtime/tag_limits.rb +0 -15
- data/spec/cucumber/mappings_spec.rb +0 -180
- data/spec/cucumber/reports/legacy_formatter_spec.rb +0 -1860
- data/spec/cucumber/runtime/results_spec.rb +0 -88
data/bin/cuke
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# encoding: UTF-8
|
|
3
|
-
$: << File.dirname(__FILE__) + '/../lib'
|
|
4
|
-
$: << File.dirname(__FILE__) + '/../../cucumber-ruby-core/lib'
|
|
5
|
-
|
|
6
|
-
require 'cucumber/platform'
|
|
7
|
-
|
|
8
|
-
module Cucumber
|
|
9
|
-
|
|
10
|
-
features_glob = ARGV[0] || 'features/**/*.feature'
|
|
11
|
-
feature_files = Dir[features_glob].reject { |f| f =~ /iso-8859-1/ }
|
|
12
|
-
puts "Running features:"
|
|
13
|
-
p feature_files
|
|
14
|
-
|
|
15
|
-
require 'cucumber/core'
|
|
16
|
-
extend Cucumber::Core
|
|
17
|
-
|
|
18
|
-
require 'cucumber/core/gherkin/document'
|
|
19
|
-
features = feature_files.map do |file|
|
|
20
|
-
Cucumber::Core::Gherkin::Document.new(file, File.read(file))
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
require 'cucumber/mappings'
|
|
24
|
-
mappings = Mappings.new
|
|
25
|
-
|
|
26
|
-
require 'cucumber/formatter/report_adapter'
|
|
27
|
-
require 'cucumber/formatter/progress'
|
|
28
|
-
require 'cucumber/formatter/pretty'
|
|
29
|
-
formatter_options = {
|
|
30
|
-
skip_profile_information: true,
|
|
31
|
-
source: true,
|
|
32
|
-
}
|
|
33
|
-
formatter = Cucumber::Formatter::Pretty.new(mappings.runtime, STDOUT, formatter_options)
|
|
34
|
-
report = Cucumber::Formatter::ReportAdapter.new(mappings.runtime, formatter)
|
|
35
|
-
|
|
36
|
-
DebugReport = Class.new do
|
|
37
|
-
def before_test_case(test_case)
|
|
38
|
-
puts
|
|
39
|
-
puts test_case.inspect
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def after_test_case(test_case, result)
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def before_test_step(test_step)
|
|
46
|
-
puts ' ' + test_step.inspect
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def after_test_step(test_step, result)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def after_suite
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
#report = DebugReport.new
|
|
56
|
-
|
|
57
|
-
require 'cucumber/core/test/tag_filter'
|
|
58
|
-
execute features, mappings, report, [[Cucumber::Core::Test::TagFilter, ['~@jruby']]]
|
|
59
|
-
report.after_suite
|
|
60
|
-
end
|
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
Feature: Formatter Callback
|
|
2
|
-
|
|
3
|
-
Scenario: callback if not expanded
|
|
4
|
-
Given a file named "features/f.feature" with:
|
|
5
|
-
"""
|
|
6
|
-
Feature: I'll use my own
|
|
7
|
-
because I'm worth it
|
|
8
|
-
Scenario: just print me
|
|
9
|
-
Given this step works
|
|
10
|
-
Scenario Outline: outline
|
|
11
|
-
Given <x> step works
|
|
12
|
-
Then <y>
|
|
13
|
-
Examples:
|
|
14
|
-
|x|y|
|
|
15
|
-
|this|that|
|
|
16
|
-
|here|there|
|
|
17
|
-
"""
|
|
18
|
-
And a file named "features/step_definitions/steps.rb" with:
|
|
19
|
-
"""
|
|
20
|
-
Given(/^.+ step works$/) { }
|
|
21
|
-
Then(/^that|there$/) { }
|
|
22
|
-
"""
|
|
23
|
-
When I run `cucumber features/f.feature --format debug`
|
|
24
|
-
Then it should pass with exactly:
|
|
25
|
-
"""
|
|
26
|
-
before_features
|
|
27
|
-
before_feature
|
|
28
|
-
before_tags
|
|
29
|
-
after_tags
|
|
30
|
-
feature_name
|
|
31
|
-
before_feature_element
|
|
32
|
-
before_tags
|
|
33
|
-
after_tags
|
|
34
|
-
scenario_name
|
|
35
|
-
before_steps
|
|
36
|
-
before_step
|
|
37
|
-
before_step_result
|
|
38
|
-
step_name
|
|
39
|
-
after_step_result
|
|
40
|
-
after_step
|
|
41
|
-
after_steps
|
|
42
|
-
after_feature_element
|
|
43
|
-
before_feature_element
|
|
44
|
-
before_tags
|
|
45
|
-
after_tags
|
|
46
|
-
scenario_name
|
|
47
|
-
before_steps
|
|
48
|
-
before_step
|
|
49
|
-
before_step_result
|
|
50
|
-
step_name
|
|
51
|
-
after_step_result
|
|
52
|
-
after_step
|
|
53
|
-
before_step
|
|
54
|
-
before_step_result
|
|
55
|
-
step_name
|
|
56
|
-
after_step_result
|
|
57
|
-
after_step
|
|
58
|
-
after_steps
|
|
59
|
-
before_examples_array
|
|
60
|
-
before_examples
|
|
61
|
-
examples_name
|
|
62
|
-
before_outline_table
|
|
63
|
-
before_table_row
|
|
64
|
-
before_table_cell
|
|
65
|
-
table_cell_value
|
|
66
|
-
after_table_cell
|
|
67
|
-
before_table_cell
|
|
68
|
-
table_cell_value
|
|
69
|
-
after_table_cell
|
|
70
|
-
after_table_row
|
|
71
|
-
before_table_row
|
|
72
|
-
before_table_cell
|
|
73
|
-
table_cell_value
|
|
74
|
-
after_table_cell
|
|
75
|
-
before_table_cell
|
|
76
|
-
table_cell_value
|
|
77
|
-
after_table_cell
|
|
78
|
-
after_table_row
|
|
79
|
-
before_table_row
|
|
80
|
-
before_table_cell
|
|
81
|
-
table_cell_value
|
|
82
|
-
after_table_cell
|
|
83
|
-
before_table_cell
|
|
84
|
-
table_cell_value
|
|
85
|
-
after_table_cell
|
|
86
|
-
after_table_row
|
|
87
|
-
after_outline_table
|
|
88
|
-
after_examples
|
|
89
|
-
after_examples_array
|
|
90
|
-
after_feature_element
|
|
91
|
-
after_feature
|
|
92
|
-
after_features
|
|
93
|
-
|
|
94
|
-
"""
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Scenario: callback if expanded
|
|
98
|
-
Given a file named "features/f.feature" with:
|
|
99
|
-
"""
|
|
100
|
-
Feature: I'll use my own
|
|
101
|
-
because I'm worth it
|
|
102
|
-
Scenario: just print me
|
|
103
|
-
Given this step works
|
|
104
|
-
Scenario Outline: outline
|
|
105
|
-
Given <x> step works
|
|
106
|
-
Then <y>
|
|
107
|
-
Examples:
|
|
108
|
-
|x|y|
|
|
109
|
-
|this|that|
|
|
110
|
-
|here|there|
|
|
111
|
-
"""
|
|
112
|
-
And a file named "features/step_definitions/steps.rb" with:
|
|
113
|
-
"""
|
|
114
|
-
Given /^.+ step works$/ do
|
|
115
|
-
end
|
|
116
|
-
Then /^that|there$/ do
|
|
117
|
-
end
|
|
118
|
-
"""
|
|
119
|
-
When I run `cucumber features/f.feature --format debug --expand`
|
|
120
|
-
Then it should pass with exactly:
|
|
121
|
-
"""
|
|
122
|
-
before_features
|
|
123
|
-
before_feature
|
|
124
|
-
before_tags
|
|
125
|
-
after_tags
|
|
126
|
-
feature_name
|
|
127
|
-
before_feature_element
|
|
128
|
-
before_tags
|
|
129
|
-
after_tags
|
|
130
|
-
scenario_name
|
|
131
|
-
before_steps
|
|
132
|
-
before_step
|
|
133
|
-
before_step_result
|
|
134
|
-
step_name
|
|
135
|
-
after_step_result
|
|
136
|
-
after_step
|
|
137
|
-
after_steps
|
|
138
|
-
after_feature_element
|
|
139
|
-
before_feature_element
|
|
140
|
-
before_tags
|
|
141
|
-
after_tags
|
|
142
|
-
scenario_name
|
|
143
|
-
before_steps
|
|
144
|
-
before_step
|
|
145
|
-
before_step_result
|
|
146
|
-
step_name
|
|
147
|
-
after_step_result
|
|
148
|
-
after_step
|
|
149
|
-
before_step
|
|
150
|
-
before_step_result
|
|
151
|
-
step_name
|
|
152
|
-
after_step_result
|
|
153
|
-
after_step
|
|
154
|
-
after_steps
|
|
155
|
-
before_examples_array
|
|
156
|
-
before_examples
|
|
157
|
-
examples_name
|
|
158
|
-
before_outline_table
|
|
159
|
-
scenario_name
|
|
160
|
-
before_step
|
|
161
|
-
before_step_result
|
|
162
|
-
step_name
|
|
163
|
-
after_step_result
|
|
164
|
-
after_step
|
|
165
|
-
before_step
|
|
166
|
-
before_step_result
|
|
167
|
-
step_name
|
|
168
|
-
after_step_result
|
|
169
|
-
after_step
|
|
170
|
-
scenario_name
|
|
171
|
-
before_step
|
|
172
|
-
before_step_result
|
|
173
|
-
step_name
|
|
174
|
-
after_step_result
|
|
175
|
-
after_step
|
|
176
|
-
before_step
|
|
177
|
-
before_step_result
|
|
178
|
-
step_name
|
|
179
|
-
after_step_result
|
|
180
|
-
after_step
|
|
181
|
-
after_outline_table
|
|
182
|
-
after_examples
|
|
183
|
-
after_examples_array
|
|
184
|
-
after_feature_element
|
|
185
|
-
after_feature
|
|
186
|
-
after_features
|
|
187
|
-
|
|
188
|
-
"""
|
|
189
|
-
|
|
190
|
-
Scenario: callback with background if not expanded
|
|
191
|
-
Given a file named "features/f.feature" with:
|
|
192
|
-
"""
|
|
193
|
-
Feature: I'll use my own
|
|
194
|
-
because I'm worth it
|
|
195
|
-
Background:
|
|
196
|
-
Given this step works
|
|
197
|
-
Scenario Outline: outline
|
|
198
|
-
Given <x> step works
|
|
199
|
-
Then <y>
|
|
200
|
-
Examples:
|
|
201
|
-
|x|y|
|
|
202
|
-
|this|that|
|
|
203
|
-
|here|there|
|
|
204
|
-
"""
|
|
205
|
-
And a file named "features/step_definitions/steps.rb" with:
|
|
206
|
-
"""
|
|
207
|
-
Given(/^.+ step works$/) { }
|
|
208
|
-
Then(/^that|there$/) { }
|
|
209
|
-
"""
|
|
210
|
-
When I run `cucumber features/f.feature --format debug`
|
|
211
|
-
Then it should pass with exactly:
|
|
212
|
-
"""
|
|
213
|
-
before_features
|
|
214
|
-
before_feature
|
|
215
|
-
before_tags
|
|
216
|
-
after_tags
|
|
217
|
-
feature_name
|
|
218
|
-
before_background
|
|
219
|
-
background_name
|
|
220
|
-
before_steps
|
|
221
|
-
before_step
|
|
222
|
-
before_step_result
|
|
223
|
-
step_name
|
|
224
|
-
after_step_result
|
|
225
|
-
after_step
|
|
226
|
-
after_steps
|
|
227
|
-
after_background
|
|
228
|
-
before_feature_element
|
|
229
|
-
before_tags
|
|
230
|
-
after_tags
|
|
231
|
-
scenario_name
|
|
232
|
-
before_steps
|
|
233
|
-
before_step
|
|
234
|
-
before_step_result
|
|
235
|
-
step_name
|
|
236
|
-
after_step_result
|
|
237
|
-
after_step
|
|
238
|
-
before_step
|
|
239
|
-
before_step_result
|
|
240
|
-
step_name
|
|
241
|
-
after_step_result
|
|
242
|
-
after_step
|
|
243
|
-
after_steps
|
|
244
|
-
before_examples_array
|
|
245
|
-
before_examples
|
|
246
|
-
examples_name
|
|
247
|
-
before_outline_table
|
|
248
|
-
before_table_row
|
|
249
|
-
before_table_cell
|
|
250
|
-
table_cell_value
|
|
251
|
-
after_table_cell
|
|
252
|
-
before_table_cell
|
|
253
|
-
table_cell_value
|
|
254
|
-
after_table_cell
|
|
255
|
-
after_table_row
|
|
256
|
-
before_table_row
|
|
257
|
-
before_table_cell
|
|
258
|
-
table_cell_value
|
|
259
|
-
after_table_cell
|
|
260
|
-
before_table_cell
|
|
261
|
-
table_cell_value
|
|
262
|
-
after_table_cell
|
|
263
|
-
after_table_row
|
|
264
|
-
before_table_row
|
|
265
|
-
before_table_cell
|
|
266
|
-
table_cell_value
|
|
267
|
-
after_table_cell
|
|
268
|
-
before_table_cell
|
|
269
|
-
table_cell_value
|
|
270
|
-
after_table_cell
|
|
271
|
-
after_table_row
|
|
272
|
-
after_outline_table
|
|
273
|
-
after_examples
|
|
274
|
-
after_examples_array
|
|
275
|
-
after_feature_element
|
|
276
|
-
after_feature
|
|
277
|
-
after_features
|
|
278
|
-
|
|
279
|
-
"""
|
|
280
|
-
|
|
281
|
-
Scenario: callback with background if expanded
|
|
282
|
-
Given a file named "features/f.feature" with:
|
|
283
|
-
"""
|
|
284
|
-
Feature: I'll use my own
|
|
285
|
-
because I'm worth it
|
|
286
|
-
Background:
|
|
287
|
-
Given this step works
|
|
288
|
-
Scenario Outline: outline
|
|
289
|
-
Given <x> step works
|
|
290
|
-
Then <y>
|
|
291
|
-
Examples:
|
|
292
|
-
|x|y|
|
|
293
|
-
|this|that|
|
|
294
|
-
|here|there|
|
|
295
|
-
"""
|
|
296
|
-
And a file named "features/step_definitions/steps.rb" with:
|
|
297
|
-
"""
|
|
298
|
-
Given /^.+ step works$/ do
|
|
299
|
-
end
|
|
300
|
-
Then /^that|there$/ do
|
|
301
|
-
end
|
|
302
|
-
"""
|
|
303
|
-
When I run `cucumber features/f.feature --format debug --expand`
|
|
304
|
-
Then it should pass with exactly:
|
|
305
|
-
"""
|
|
306
|
-
before_features
|
|
307
|
-
before_feature
|
|
308
|
-
before_tags
|
|
309
|
-
after_tags
|
|
310
|
-
feature_name
|
|
311
|
-
before_background
|
|
312
|
-
background_name
|
|
313
|
-
before_steps
|
|
314
|
-
before_step
|
|
315
|
-
before_step_result
|
|
316
|
-
step_name
|
|
317
|
-
after_step_result
|
|
318
|
-
after_step
|
|
319
|
-
after_steps
|
|
320
|
-
after_background
|
|
321
|
-
before_feature_element
|
|
322
|
-
before_tags
|
|
323
|
-
after_tags
|
|
324
|
-
scenario_name
|
|
325
|
-
before_steps
|
|
326
|
-
before_step
|
|
327
|
-
before_step_result
|
|
328
|
-
step_name
|
|
329
|
-
after_step_result
|
|
330
|
-
after_step
|
|
331
|
-
before_step
|
|
332
|
-
before_step_result
|
|
333
|
-
step_name
|
|
334
|
-
after_step_result
|
|
335
|
-
after_step
|
|
336
|
-
after_steps
|
|
337
|
-
before_examples_array
|
|
338
|
-
before_examples
|
|
339
|
-
examples_name
|
|
340
|
-
before_outline_table
|
|
341
|
-
scenario_name
|
|
342
|
-
before_step
|
|
343
|
-
before_step_result
|
|
344
|
-
step_name
|
|
345
|
-
after_step_result
|
|
346
|
-
after_step
|
|
347
|
-
before_step
|
|
348
|
-
before_step_result
|
|
349
|
-
step_name
|
|
350
|
-
after_step_result
|
|
351
|
-
after_step
|
|
352
|
-
scenario_name
|
|
353
|
-
before_step
|
|
354
|
-
before_step_result
|
|
355
|
-
step_name
|
|
356
|
-
after_step_result
|
|
357
|
-
after_step
|
|
358
|
-
before_step
|
|
359
|
-
before_step_result
|
|
360
|
-
step_name
|
|
361
|
-
after_step_result
|
|
362
|
-
after_step
|
|
363
|
-
after_outline_table
|
|
364
|
-
after_examples
|
|
365
|
-
after_examples_array
|
|
366
|
-
after_feature_element
|
|
367
|
-
after_feature
|
|
368
|
-
after_features
|
|
369
|
-
|
|
370
|
-
"""
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
Feature: Hook output feature
|
|
2
|
-
|
|
3
|
-
Calls to puts and embed in hook, should be passed to the formatters.
|
|
4
|
-
|
|
5
|
-
Background:
|
|
6
|
-
Given the standard step definitions
|
|
7
|
-
|
|
8
|
-
Scenario: Output from hooks
|
|
9
|
-
Given a file named "features/test.feature" with:
|
|
10
|
-
"""
|
|
11
|
-
Feature:
|
|
12
|
-
Scenario:
|
|
13
|
-
Given this step passes
|
|
14
|
-
Scenario Outline:
|
|
15
|
-
Given this step <status>
|
|
16
|
-
Examples:
|
|
17
|
-
| status |
|
|
18
|
-
| passes |
|
|
19
|
-
"""
|
|
20
|
-
And a file named "features/step_definitions/output_steps.rb" with:
|
|
21
|
-
"""
|
|
22
|
-
Before do
|
|
23
|
-
puts "Before hook 1"
|
|
24
|
-
embed "src", "mime_type", "label"
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
Before do
|
|
28
|
-
puts "Before hook 2"
|
|
29
|
-
embed "src", "mime_type", "label"
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
AfterStep do
|
|
33
|
-
puts "AfterStep hook 1"
|
|
34
|
-
embed "src", "mime_type", "label"
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
AfterStep do
|
|
38
|
-
puts "AfterStep hook 2"
|
|
39
|
-
embed "src", "mime_type", "label"
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
After do
|
|
43
|
-
puts "After hook 1"
|
|
44
|
-
embed "src", "mime_type", "label"
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
After do
|
|
48
|
-
puts "After hook 2"
|
|
49
|
-
embed "src", "mime_type", "label"
|
|
50
|
-
end
|
|
51
|
-
"""
|
|
52
|
-
When I run `cucumber -f debug`
|
|
53
|
-
Then the stderr should not contain anything
|
|
54
|
-
Then it should pass with:
|
|
55
|
-
"""
|
|
56
|
-
before_features
|
|
57
|
-
before_feature
|
|
58
|
-
before_tags
|
|
59
|
-
after_tags
|
|
60
|
-
feature_name
|
|
61
|
-
before_feature_element
|
|
62
|
-
before_tags
|
|
63
|
-
after_tags
|
|
64
|
-
scenario_name
|
|
65
|
-
puts
|
|
66
|
-
embed
|
|
67
|
-
puts
|
|
68
|
-
embed
|
|
69
|
-
before_steps
|
|
70
|
-
before_step
|
|
71
|
-
before_step_result
|
|
72
|
-
step_name
|
|
73
|
-
after_step_result
|
|
74
|
-
after_step
|
|
75
|
-
puts
|
|
76
|
-
embed
|
|
77
|
-
puts
|
|
78
|
-
embed
|
|
79
|
-
after_steps
|
|
80
|
-
puts
|
|
81
|
-
embed
|
|
82
|
-
puts
|
|
83
|
-
embed
|
|
84
|
-
after_feature_element
|
|
85
|
-
before_feature_element
|
|
86
|
-
before_tags
|
|
87
|
-
after_tags
|
|
88
|
-
scenario_name
|
|
89
|
-
before_steps
|
|
90
|
-
before_step
|
|
91
|
-
before_step_result
|
|
92
|
-
step_name
|
|
93
|
-
after_step_result
|
|
94
|
-
after_step
|
|
95
|
-
after_steps
|
|
96
|
-
before_examples_array
|
|
97
|
-
before_examples
|
|
98
|
-
examples_name
|
|
99
|
-
before_outline_table
|
|
100
|
-
before_table_row
|
|
101
|
-
before_table_cell
|
|
102
|
-
table_cell_value
|
|
103
|
-
after_table_cell
|
|
104
|
-
after_table_row
|
|
105
|
-
puts
|
|
106
|
-
embed
|
|
107
|
-
puts
|
|
108
|
-
embed
|
|
109
|
-
before_table_row
|
|
110
|
-
before_table_cell
|
|
111
|
-
table_cell_value
|
|
112
|
-
after_table_cell
|
|
113
|
-
after_table_row
|
|
114
|
-
puts
|
|
115
|
-
embed
|
|
116
|
-
puts
|
|
117
|
-
embed
|
|
118
|
-
puts
|
|
119
|
-
embed
|
|
120
|
-
puts
|
|
121
|
-
embed
|
|
122
|
-
after_outline_table
|
|
123
|
-
after_examples
|
|
124
|
-
after_examples_array
|
|
125
|
-
after_feature_element
|
|
126
|
-
after_feature
|
|
127
|
-
after_features
|
|
128
|
-
"""
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
@spawn
|
|
6
|
-
Scenario: Get info at arbitrary levels of nesting
|
|
7
|
-
Given a file named "features/call_undefined_step_from_step_def.feature" with:
|
|
8
|
-
"""
|
|
9
|
-
Feature: Calling undefined step
|
|
10
|
-
|
|
11
|
-
Scenario: Call from feature
|
|
12
|
-
Given this directly called step does not exist
|
|
13
|
-
|
|
14
|
-
Scenario: Call directly
|
|
15
|
-
Given a step that calls an undefined step
|
|
16
|
-
|
|
17
|
-
Scenario: Call via another
|
|
18
|
-
Given a step that calls a step that calls an undefined step
|
|
19
|
-
"""
|
|
20
|
-
And a file named "features/step_definitions/steps.rb" with:
|
|
21
|
-
"""
|
|
22
|
-
Given /^a step that calls an undefined step$/ do
|
|
23
|
-
step 'this does not exist'
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
Given /^a step that calls a step that calls an undefined step$/ do
|
|
27
|
-
step 'a step that calls an undefined step'
|
|
28
|
-
end
|
|
29
|
-
"""
|
|
30
|
-
When I run `cucumber --strict -q features/call_undefined_step_from_step_def.feature`
|
|
31
|
-
Then it should fail with exactly:
|
|
32
|
-
"""
|
|
33
|
-
Feature: Calling undefined step
|
|
34
|
-
|
|
35
|
-
Scenario: Call from feature
|
|
36
|
-
Given this directly called step does not exist
|
|
37
|
-
Undefined step: "this directly called step does not exist" (Cucumber::Undefined)
|
|
38
|
-
features/call_undefined_step_from_step_def.feature:4:in `Given this directly called step does not exist'
|
|
39
|
-
|
|
40
|
-
Scenario: Call directly
|
|
41
|
-
Given a step that calls an undefined step
|
|
42
|
-
Undefined step: "this does not exist" (Cucumber::Undefined)
|
|
43
|
-
./features/step_definitions/steps.rb:2:in `/^a step that calls an undefined step$/'
|
|
44
|
-
features/call_undefined_step_from_step_def.feature:7:in `Given a step that calls an undefined step'
|
|
45
|
-
|
|
46
|
-
Scenario: Call via another
|
|
47
|
-
Given a step that calls a step that calls an undefined step
|
|
48
|
-
Undefined step: "this does not exist" (Cucumber::Undefined)
|
|
49
|
-
./features/step_definitions/steps.rb:2:in `/^a step that calls an undefined step$/'
|
|
50
|
-
./features/step_definitions/steps.rb:6:in `/^a step that calls a step that calls an undefined step$/'
|
|
51
|
-
features/call_undefined_step_from_step_def.feature:10:in `Given a step that calls a step that calls an undefined step'
|
|
52
|
-
|
|
53
|
-
3 scenarios (3 undefined)
|
|
54
|
-
3 steps (3 undefined)
|
|
55
|
-
0m0.012s
|
|
56
|
-
|
|
57
|
-
"""
|