cucumber 4.0.0.rc.4 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,6 +36,7 @@ module Cucumber
36
36
  @config = config
37
37
  @options = config.to_hash
38
38
  @snippets_input = []
39
+ @undefined_parameter_types = []
39
40
  @total_duration = 0
40
41
  @exceptions = []
41
42
  @gherkin_sources = {}
@@ -54,6 +55,11 @@ module Cucumber
54
55
  @passed_test_cases = []
55
56
  @source_indent = 0
56
57
  @next_comment_to_be_printed = 0
58
+
59
+ bind_events(config)
60
+ end
61
+
62
+ def bind_events(config)
57
63
  config.on_event :gherkin_source_read, &method(:on_gherkin_source_read)
58
64
  config.on_event :step_activated, &method(:on_step_activated)
59
65
  config.on_event :test_case_started, &method(:on_test_case_started)
@@ -61,6 +67,7 @@ module Cucumber
61
67
  config.on_event :test_step_finished, &method(:on_test_step_finished)
62
68
  config.on_event :test_case_finished, &method(:on_test_case_finished)
63
69
  config.on_event :test_run_finished, &method(:on_test_run_finished)
70
+ config.on_event :undefined_parameter_type, &method(:collect_undefined_parameter_type_names)
64
71
  end
65
72
 
66
73
  def on_gherkin_source_read(event)
@@ -21,6 +21,7 @@ module Cucumber
21
21
  @config = config
22
22
  @io = ensure_io(config.out_stream)
23
23
  @snippets_input = []
24
+ @undefined_parameter_types = []
24
25
  @total_duration = 0
25
26
  @matches = {}
26
27
  @pending_step_matches = []
@@ -36,6 +37,7 @@ module Cucumber
36
37
  config.on_event :test_step_finished, &method(:on_test_step_finished)
37
38
  config.on_event :test_case_finished, &method(:on_test_case_finished)
38
39
  config.on_event :test_run_finished, &method(:on_test_run_finished)
40
+ config.on_event :undefined_parameter_type, &method(:collect_undefined_parameter_type_names)
39
41
  end
40
42
 
41
43
  def on_step_activated(event)
@@ -107,9 +107,8 @@ module Cucumber
107
107
  attach(file, mime_type)
108
108
  end
109
109
 
110
- def log(message)
111
- raise Cucumber::LogTypeInvalid unless message.is_a?(String)
112
- attach(message.dup, 'text/x.cucumber.log+plain')
110
+ def log(*messages)
111
+ messages.each { |message| attach(message.to_s.dup, 'text/x.cucumber.log+plain') }
113
112
  end
114
113
 
115
114
  def attach(file, media_type)
@@ -93,12 +93,7 @@ module Cucumber
93
93
  # TODO: add a way to extract the parameter type directly from the error.
94
94
  type_name = e.message.match(/^Undefined parameter type \{(.*)\}$/)[1]
95
95
 
96
- @configuration.notify :envelope, Cucumber::Messages::Envelope.new(
97
- undefined_parameter_type: Cucumber::Messages::UndefinedParameterType.new(
98
- name: type_name,
99
- expression: string_or_regexp
100
- )
101
- )
96
+ @configuration.notify :undefined_parameter_type, type_name, string_or_regexp
102
97
  end
103
98
 
104
99
  def build_rb_world_factory(world_modules, namespaced_world_modules, proc)
@@ -192,6 +187,7 @@ module Cucumber
192
187
 
193
188
  Cucumber::Messages::Envelope.new(
194
189
  parameter_type: Cucumber::Messages::ParameterType.new(
190
+ id: @configuration.id_generator.new_id,
195
191
  name: parameter_type.name,
196
192
  regular_expressions: parameter_type.regexps.map(&:to_s),
197
193
  prefer_for_regular_expression_match: parameter_type.prefer_for_regexp_match?,
@@ -174,7 +174,7 @@ module Cucumber
174
174
 
175
175
  class DocString
176
176
  def append_block_parameter_to(array)
177
- array << 'string'
177
+ array << 'doc_string'
178
178
  end
179
179
 
180
180
  def append_comment_to(string); end
@@ -77,7 +77,7 @@ module Cucumber
77
77
  Cucumber::Messages::Envelope.new(
78
78
  step_definition: Cucumber::Messages::StepDefinition.new(
79
79
  id: id,
80
- pattern: Cucumber::Messages::StepDefinitionPattern.new(
80
+ pattern: Cucumber::Messages::StepDefinition::StepDefinitionPattern.new(
81
81
  source: expression.source.to_s,
82
82
  type: expression_type
83
83
  ),
@@ -92,8 +92,8 @@ module Cucumber
92
92
  end
93
93
 
94
94
  def expression_type
95
- return Cucumber::Messages::StepDefinitionPatternType::CUCUMBER_EXPRESSION if expression.is_a?(CucumberExpressions::CucumberExpression)
96
- Cucumber::Messages::StepDefinitionPatternType::REGULAR_EXPRESSION
95
+ return Cucumber::Messages::StepDefinition::StepDefinitionPattern::StepDefinitionPatternType::CUCUMBER_EXPRESSION if expression.is_a?(CucumberExpressions::CucumberExpression)
96
+ Cucumber::Messages::StepDefinition::StepDefinitionPattern::StepDefinitionPatternType::REGULAR_EXPRESSION
97
97
  end
98
98
 
99
99
  # @api private
@@ -7,7 +7,7 @@ require 'cucumber/core/platform'
7
7
 
8
8
  module Cucumber
9
9
  unless defined?(Cucumber::VERSION)
10
- VERSION = File.read(File.expand_path('version', __dir__))
10
+ VERSION = File.read(File.expand_path('version', __dir__)).strip
11
11
  BINARY = File.expand_path(File.dirname(__FILE__) + '/../../bin/cucumber')
12
12
  LIBDIR = File.expand_path(File.dirname(__FILE__) + '/../../lib')
13
13
  RAILS = defined?(Rails)
@@ -156,7 +156,7 @@ module Cucumber
156
156
 
157
157
  def runner(_task_args = nil) #:nodoc:
158
158
  cucumber_opts = [(ENV['CUCUMBER_OPTS'] ? ENV['CUCUMBER_OPTS'].split(/\s+/) : nil) || cucumber_opts_with_profile]
159
- return ForkedCucumberRunner.new(libs, binary, cucumber_opts, bundler, feature_files) if @fork
159
+ return ForkedCucumberRunner.new(libs, binary, cucumber_opts, bundler, feature_files) if fork
160
160
  InProcessCucumberRunner.new(libs, cucumber_opts, feature_files)
161
161
  end
162
162
 
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'fileutils'
4
- require 'multi_json'
5
4
  require 'cucumber/configuration'
5
+ require 'cucumber/create_meta'
6
6
  require 'cucumber/load_path'
7
7
  require 'cucumber/formatter/duration'
8
8
  require 'cucumber/file_specs'
@@ -10,6 +10,8 @@ require 'cucumber/filters'
10
10
  require 'cucumber/formatter/fanout'
11
11
  require 'cucumber/gherkin/i18n'
12
12
  require 'cucumber/step_match_search'
13
+ require 'cucumber/messages'
14
+ require 'sys/uname'
13
15
 
14
16
  module Cucumber
15
17
  module FixRuby21Bug9285
@@ -63,6 +65,10 @@ module Cucumber
63
65
 
64
66
  require 'cucumber/wire/plugin'
65
67
  def run!
68
+ @configuration.notify :envelope, Cucumber::Messages::Envelope.new(
69
+ meta: Cucumber::CreateMeta.create_meta('cucumber-ruby', Cucumber::VERSION)
70
+ )
71
+
66
72
  load_step_definitions
67
73
  install_wire_plugin
68
74
  fire_after_configuration_hook
@@ -3,9 +3,10 @@
3
3
  module Cucumber
4
4
  class Runtime
5
5
  class StepHooks
6
- def initialize(id_generator, hooks)
6
+ def initialize(id_generator, hooks, event_bus)
7
7
  @hooks = hooks
8
8
  @id_generator = id_generator
9
+ @event_bus = event_bus
9
10
  end
10
11
 
11
12
  def apply(test_steps)
@@ -19,7 +20,9 @@ module Cucumber
19
20
  def after_step_hooks(test_step)
20
21
  @hooks.map do |hook|
21
22
  action = ->(*args) { hook.invoke('AfterStep', [args, test_step]) }
22
- Hooks.after_step_hook(@id_generator.new_id, test_step, hook.location, &action)
23
+ hook_step = Hooks.after_step_hook(@id_generator.new_id, test_step, hook.location, &action)
24
+ @event_bus.hook_test_step_created(hook_step, hook)
25
+ hook_step
23
26
  end
24
27
  end
25
28
  end
@@ -104,7 +104,7 @@ module Cucumber
104
104
  def find_after_step_hooks(test_case)
105
105
  scenario = RunningTestCase.new(test_case)
106
106
  hooks = registry.hooks_for(:after_step, scenario)
107
- StepHooks.new(@configuration.id_generator, hooks)
107
+ StepHooks.new(@configuration.id_generator, hooks, @configuration.event_bus)
108
108
  end
109
109
 
110
110
  def apply_before_hooks(test_case)
@@ -1 +1 @@
1
- 4.0.0.rc.4
1
+ 4.1.0
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.rc.4
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
8
8
  - Matt Wynne
9
9
  - Steve Tooke
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-02-24 00:00:00.000000000 Z
13
+ date: 2020-07-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: builder
@@ -38,120 +38,166 @@ dependencies:
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 6.0.0
41
+ version: 7.1.0
42
42
  - - "~>"
43
43
  - !ruby/object:Gem::Version
44
- version: '6.0'
44
+ version: '7.1'
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - ">="
50
50
  - !ruby/object:Gem::Version
51
- version: 6.0.0
51
+ version: 7.1.0
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '6.0'
54
+ version: '7.1'
55
55
  - !ruby/object:Gem::Dependency
56
- name: cucumber-expressions
56
+ name: cucumber-create-meta
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.0
62
+ - - "~>"
63
+ - !ruby/object:Gem::Version
64
+ version: 1.0.0
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 1.0.0
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: 1.0.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: cucumber-cucumber-expressions
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 10.1.0
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: '10.1'
85
+ type: :runtime
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: 10.1.0
59
92
  - - "~>"
60
93
  - !ruby/object:Gem::Version
61
- version: '8.0'
94
+ version: '10.1'
95
+ - !ruby/object:Gem::Dependency
96
+ name: cucumber-gherkin
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '14.0'
62
102
  - - ">="
63
103
  - !ruby/object:Gem::Version
64
- version: 8.0.2
104
+ version: 14.0.1
65
105
  type: :runtime
66
106
  prerelease: false
67
107
  version_requirements: !ruby/object:Gem::Requirement
68
108
  requirements:
69
109
  - - "~>"
70
110
  - !ruby/object:Gem::Version
71
- version: '8.0'
111
+ version: '14.0'
72
112
  - - ">="
73
113
  - !ruby/object:Gem::Version
74
- version: 8.0.2
114
+ version: 14.0.1
75
115
  - !ruby/object:Gem::Dependency
76
- name: cucumber-gherkin
116
+ name: cucumber-html-formatter
77
117
  requirement: !ruby/object:Gem::Requirement
78
118
  requirements:
79
119
  - - ">="
80
120
  - !ruby/object:Gem::Version
81
- version: 10.0.0
121
+ version: 7.0.0
82
122
  - - "~>"
83
123
  - !ruby/object:Gem::Version
84
- version: '10.0'
124
+ version: '7.0'
85
125
  type: :runtime
86
126
  prerelease: false
87
127
  version_requirements: !ruby/object:Gem::Requirement
88
128
  requirements:
89
129
  - - ">="
90
130
  - !ruby/object:Gem::Version
91
- version: 10.0.0
131
+ version: 7.0.0
92
132
  - - "~>"
93
133
  - !ruby/object:Gem::Version
94
- version: '10.0'
134
+ version: '7.0'
95
135
  - !ruby/object:Gem::Dependency
96
- name: cucumber-wire
136
+ name: cucumber-messages
97
137
  requirement: !ruby/object:Gem::Requirement
98
138
  requirements:
99
139
  - - ">="
100
140
  - !ruby/object:Gem::Version
101
- version: 2.0.0
141
+ version: 12.2.0
102
142
  - - "~>"
103
143
  - !ruby/object:Gem::Version
104
- version: '2.0'
144
+ version: '12.2'
105
145
  type: :runtime
106
146
  prerelease: false
107
147
  version_requirements: !ruby/object:Gem::Requirement
108
148
  requirements:
109
149
  - - ">="
110
150
  - !ruby/object:Gem::Version
111
- version: 2.0.0
151
+ version: 12.2.0
112
152
  - - "~>"
113
153
  - !ruby/object:Gem::Version
114
- version: '2.0'
154
+ version: '12.2'
115
155
  - !ruby/object:Gem::Dependency
116
- name: diff-lcs
156
+ name: cucumber-wire
117
157
  requirement: !ruby/object:Gem::Requirement
118
158
  requirements:
119
159
  - - ">="
120
160
  - !ruby/object:Gem::Version
121
- version: '1.3'
161
+ version: 3.1.0
122
162
  - - "~>"
123
163
  - !ruby/object:Gem::Version
124
- version: '1.3'
164
+ version: '3.1'
125
165
  type: :runtime
126
166
  prerelease: false
127
167
  version_requirements: !ruby/object:Gem::Requirement
128
168
  requirements:
129
169
  - - ">="
130
170
  - !ruby/object:Gem::Version
131
- version: '1.3'
171
+ version: 3.1.0
132
172
  - - "~>"
133
173
  - !ruby/object:Gem::Version
134
- version: '1.3'
174
+ version: '3.1'
135
175
  - !ruby/object:Gem::Dependency
136
- name: multi_json
176
+ name: diff-lcs
137
177
  requirement: !ruby/object:Gem::Requirement
138
178
  requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '1.3'
139
182
  - - "~>"
140
183
  - !ruby/object:Gem::Version
141
- version: '1.13'
142
- - - ">="
184
+ version: '1.3'
185
+ - - "<"
143
186
  - !ruby/object:Gem::Version
144
- version: 1.13.1
187
+ version: '1.4'
145
188
  type: :runtime
146
189
  prerelease: false
147
190
  version_requirements: !ruby/object:Gem::Requirement
148
191
  requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '1.3'
149
195
  - - "~>"
150
196
  - !ruby/object:Gem::Version
151
- version: '1.13'
152
- - - ">="
197
+ version: '1.3'
198
+ - - "<"
153
199
  - !ruby/object:Gem::Version
154
- version: 1.13.1
200
+ version: '1.4'
155
201
  - !ruby/object:Gem::Dependency
156
202
  name: multi_test
157
203
  requirement: !ruby/object:Gem::Requirement
@@ -173,45 +219,25 @@ dependencies:
173
219
  - !ruby/object:Gem::Version
174
220
  version: 0.1.2
175
221
  - !ruby/object:Gem::Dependency
176
- name: aruba
222
+ name: sys-uname
177
223
  requirement: !ruby/object:Gem::Requirement
178
224
  requirements:
179
225
  - - "~>"
180
226
  - !ruby/object:Gem::Version
181
- version: '0.14'
227
+ version: '1.0'
182
228
  - - ">="
183
229
  - !ruby/object:Gem::Version
184
- version: 0.14.11
185
- type: :development
230
+ version: 1.0.2
231
+ type: :runtime
186
232
  prerelease: false
187
233
  version_requirements: !ruby/object:Gem::Requirement
188
234
  requirements:
189
235
  - - "~>"
190
236
  - !ruby/object:Gem::Version
191
- version: '0.14'
237
+ version: '1.0'
192
238
  - - ">="
193
239
  - !ruby/object:Gem::Version
194
- version: 0.14.11
195
- - !ruby/object:Gem::Dependency
196
- name: json
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: 2.2.0
202
- - - "~>"
203
- - !ruby/object:Gem::Version
204
- version: '2.2'
205
- type: :development
206
- prerelease: false
207
- version_requirements: !ruby/object:Gem::Requirement
208
- requirements:
209
- - - ">="
210
- - !ruby/object:Gem::Version
211
- version: 2.2.0
212
- - - "~>"
213
- - !ruby/object:Gem::Version
214
- version: '2.2'
240
+ version: 1.0.2
215
241
  - !ruby/object:Gem::Dependency
216
242
  name: nokogiri
217
243
  requirement: !ruby/object:Gem::Requirement
@@ -292,26 +318,6 @@ dependencies:
292
318
  - - "~>"
293
319
  - !ruby/object:Gem::Version
294
320
  version: '3.8'
295
- - !ruby/object:Gem::Dependency
296
- name: rubocop
297
- requirement: !ruby/object:Gem::Requirement
298
- requirements:
299
- - - "~>"
300
- - !ruby/object:Gem::Version
301
- version: '0.75'
302
- - - '='
303
- - !ruby/object:Gem::Version
304
- version: 0.75.1
305
- type: :development
306
- prerelease: false
307
- version_requirements: !ruby/object:Gem::Requirement
308
- requirements:
309
- - - "~>"
310
- - !ruby/object:Gem::Version
311
- version: '0.75'
312
- - - '='
313
- - !ruby/object:Gem::Version
314
- version: 0.75.1
315
321
  - !ruby/object:Gem::Dependency
316
322
  name: simplecov
317
323
  requirement: !ruby/object:Gem::Requirement
@@ -372,6 +378,26 @@ dependencies:
372
378
  - - ">="
373
379
  - !ruby/object:Gem::Version
374
380
  version: 1.2.3
381
+ - !ruby/object:Gem::Dependency
382
+ name: webrick
383
+ requirement: !ruby/object:Gem::Requirement
384
+ requirements:
385
+ - - ">="
386
+ - !ruby/object:Gem::Version
387
+ version: 1.6.0
388
+ - - "~>"
389
+ - !ruby/object:Gem::Version
390
+ version: '1.6'
391
+ type: :development
392
+ prerelease: false
393
+ version_requirements: !ruby/object:Gem::Requirement
394
+ requirements:
395
+ - - ">="
396
+ - !ruby/object:Gem::Version
397
+ version: 1.6.0
398
+ - - "~>"
399
+ - !ruby/object:Gem::Version
400
+ version: '1.6'
375
401
  - !ruby/object:Gem::Dependency
376
402
  name: octokit
377
403
  requirement: !ruby/object:Gem::Requirement
@@ -494,6 +520,7 @@ files:
494
520
  - lib/cucumber/events/test_step_created.rb
495
521
  - lib/cucumber/events/test_step_finished.rb
496
522
  - lib/cucumber/events/test_step_started.rb
523
+ - lib/cucumber/events/undefined_parameter_type.rb
497
524
  - lib/cucumber/file_specs.rb
498
525
  - lib/cucumber/filters.rb
499
526
  - lib/cucumber/filters/activate_steps.rb
@@ -522,12 +549,15 @@ files:
522
549
  - lib/cucumber/formatter/errors.rb
523
550
  - lib/cucumber/formatter/fail_fast.rb
524
551
  - lib/cucumber/formatter/fanout.rb
552
+ - lib/cucumber/formatter/html.rb
553
+ - lib/cucumber/formatter/http_io.rb
525
554
  - lib/cucumber/formatter/ignore_missing_messages.rb
526
555
  - lib/cucumber/formatter/interceptor.rb
527
556
  - lib/cucumber/formatter/io.rb
528
557
  - lib/cucumber/formatter/json.rb
529
558
  - lib/cucumber/formatter/junit.rb
530
559
  - lib/cucumber/formatter/message.rb
560
+ - lib/cucumber/formatter/message_builder.rb
531
561
  - lib/cucumber/formatter/pretty.rb
532
562
  - lib/cucumber/formatter/progress.rb
533
563
  - lib/cucumber/formatter/query/hook_by_test_step.rb
@@ -590,7 +620,7 @@ metadata:
590
620
  documentation_uri: https://www.rubydoc.info/github/cucumber/cucumber-ruby/
591
621
  mailing_list_uri: https://groups.google.com/forum/#!forum/cukes
592
622
  source_code_uri: https://github.com/cucumber/cucumber-ruby
593
- post_install_message:
623
+ post_install_message:
594
624
  rdoc_options:
595
625
  - "--charset=UTF-8"
596
626
  require_paths:
@@ -602,12 +632,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
602
632
  version: '2.3'
603
633
  required_rubygems_version: !ruby/object:Gem::Requirement
604
634
  requirements:
605
- - - ">"
635
+ - - ">="
606
636
  - !ruby/object:Gem::Version
607
- version: 1.3.1
637
+ version: '0'
608
638
  requirements: []
609
639
  rubygems_version: 3.0.6
610
- signing_key:
640
+ signing_key:
611
641
  specification_version: 4
612
- summary: cucumber-4.0.0.rc.4
642
+ summary: cucumber-4.1.0
613
643
  test_files: []