cucumber 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fc886b206588160432745dd94cb419b71dd3952
4
- data.tar.gz: ade0e5e45e889f9717baa2d2dd8fad60932bf667
3
+ metadata.gz: fef34be35b9337e5d78fe68a0b9e642e96a5bc8e
4
+ data.tar.gz: 5331fac4008b678c3bdc18ec18f4df77e3e67bfb
5
5
  SHA512:
6
- metadata.gz: f9f244e9f05394029284305f8aa39a0472507c498ca764f9c3141bc96d9521e6d37ad6ec5e898b893dc726bcd57c9537acb40e479d42660f8f3bf946adea2b92
7
- data.tar.gz: d68d77df58b2f659b5689334eb2a8833ba7bf2beb977a0da20dcb25a28e3c69e8b20bc76ecf25117e6a71914b98f4f094db85f8860f8b2caee8fbdcff3c24b7a
6
+ metadata.gz: 560857486693d265017f21421942be4bc737f852d2972cd5a76c93f678ffe4ac06a0fd58e91f52b7ccb2d5c63156c2af13cb2e11e2bdaf9e194e516ddd663387
7
+ data.tar.gz: e3ecdbb8d5a93e5e20d0e72a46be9ccb10021b12caa7d023cd3f16e845882331231764fb772cf7d1935c4db724166dbbe3eb40bbda33a4a84760ff7bd296e54a
@@ -10,31 +10,21 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
10
10
 
11
11
  ----
12
12
 
13
- ## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v3.1.1...master) (Not released)
14
-
15
- ### Added
16
-
17
- * N/A
13
+ ## [3.1.2](https://github.com/cucumber/cucumber-ruby/compare/v3.1.1...v3.1.2) (2018-07-13)
18
14
 
19
15
  ### Changed
20
16
 
21
- * N/A
22
-
23
- ### Deprecated
24
-
25
- * N/A
26
-
27
- ### Removed
28
-
29
- * N/A
17
+ * Upgraded to `cucumber-core` 3.2.0
18
+ * Change to use the gherkin step location in the Json formatter.
19
+ ([#1243](https://github.com/cucumber/cucumber-ruby/pull/1243),
20
+ [#1108](https://github.com/cucumber/cucumber-ruby/issues/1108)
21
+ [brasmusson](https://github.com/brasmusson))
30
22
 
31
23
  ### Fixed
32
24
 
33
- * N/A
34
-
35
- ### Improved
36
-
37
- * N/A
25
+ * Support ParameterType with empty capture group.
26
+ ([#404](https://github.com/cucumber/cucumber/issues/404)
27
+ [aslakhellesoy](https://github.com/aslakhellesoy))
38
28
 
39
29
  ## [3.1.1](https://github.com/cucumber/cucumber-ruby/compare/v3.1.0...v3.1.1) (2018-06-03)
40
30
 
@@ -95,32 +95,32 @@ module Cucumber
95
95
 
96
96
  @args.options do |opts|
97
97
  opts.banner = banner
98
- opts.on('-r LIBRARY|DIR', '--require LIBRARY|DIR', *require_files_msg) {|lib| require_files(lib) }
98
+ opts.on('-r LIBRARY|DIR', '--require LIBRARY|DIR', *require_files_msg) { |lib| require_files(lib) }
99
99
 
100
100
  if Cucumber::JRUBY
101
- opts.on('-j DIR', '--jars DIR', 'Load all the jars under DIR') {|jars| load_jars(jars) }
101
+ opts.on('-j DIR', '--jars DIR', 'Load all the jars under DIR') { |jars| load_jars(jars) }
102
102
  end
103
103
 
104
- opts.on("#{RETRY_FLAG} ATTEMPTS", *retry_msg) {|v| set_option :retry, v.to_i }
104
+ opts.on("#{RETRY_FLAG} ATTEMPTS", *retry_msg) { |v| set_option :retry, v.to_i }
105
105
  opts.on('--i18n-languages', *i18n_languages_msg) { list_languages_and_exit }
106
- opts.on('--i18n-keywords LANG', *i18n_keywords_msg) {|lang| language lang }
106
+ opts.on('--i18n-keywords LANG', *i18n_keywords_msg) { |lang| language lang }
107
107
  opts.on(FAIL_FAST_FLAG, 'Exit immediately following the first failing scenario') { set_option :fail_fast }
108
108
  opts.on('-f FORMAT', '--format FORMAT', *format_msg, *FORMAT_HELP) do |v|
109
109
  add_option :formats, [*parse_formats(v), @out_stream]
110
110
  end
111
- opts.on('--init', *init_msg) {|v| initialize_project }
112
- opts.on('-o', '--out [FILE|DIR]', *out_msg) {|v| out_stream v }
113
- opts.on('-t TAG_EXPRESSION', '--tags TAG_EXPRESSION', *tags_msg) {|v| add_tag v }
114
- opts.on('-n NAME', '--name NAME', *name_msg) {|v| add_option :name_regexps, /#{v}/ }
115
- opts.on('-e', '--exclude PATTERN', *exclude_msg) {|v| add_option :excludes, Regexp.new(v) }
116
- opts.on(PROFILE_SHORT_FLAG, "#{PROFILE_LONG_FLAG} PROFILE", *profile_short_flag_msg) {|v| add_profile v }
117
- opts.on(NO_PROFILE_SHORT_FLAG, NO_PROFILE_LONG_FLAG, *no_profile_short_flag_msg) {|v| disable_profile_loading }
118
- opts.on('-c', '--[no-]color', *color_msg) {|v| color v }
111
+ opts.on('--init', *init_msg) { |v| initialize_project }
112
+ opts.on('-o', '--out [FILE|DIR]', *out_msg) { |v| out_stream v }
113
+ opts.on('-t TAG_EXPRESSION', '--tags TAG_EXPRESSION', *tags_msg) { |v| add_tag v }
114
+ opts.on('-n NAME', '--name NAME', *name_msg) { |v| add_option :name_regexps, /#{v}/ }
115
+ opts.on('-e', '--exclude PATTERN', *exclude_msg) { |v| add_option :excludes, Regexp.new(v) }
116
+ opts.on(PROFILE_SHORT_FLAG, "#{PROFILE_LONG_FLAG} PROFILE", *profile_short_flag_msg) { |v| add_profile v }
117
+ opts.on(NO_PROFILE_SHORT_FLAG, NO_PROFILE_LONG_FLAG, *no_profile_short_flag_msg) { |v| disable_profile_loading }
118
+ opts.on('-c', '--[no-]color', *color_msg) { |v| color v }
119
119
  opts.on('-d', '--dry-run', *dry_run_msg) { set_dry_run_and_duration }
120
120
  opts.on('-m', '--no-multiline', "Don't print multiline strings and tables under steps.") { set_option :no_multiline }
121
121
  opts.on('-s', '--no-source', "Don't print the file and line of the step definition with the steps.") { set_option :source, false }
122
122
  opts.on('-i', '--no-snippets', "Don't print snippets for pending steps.") { set_option :snippets, false }
123
- opts.on('-I', '--snippet-type TYPE', *snippet_type_msg) {|v| set_option :snippet_type, v.to_sym }
123
+ opts.on('-I', '--snippet-type TYPE', *snippet_type_msg) { |v| set_option :snippet_type, v.to_sym }
124
124
  opts.on('-q', '--quiet', 'Alias for --no-snippets --no-source.') { shut_up }
125
125
  opts.on('--no-duration', "Don't print the duration at the end of the summary") { set_option :duration, false }
126
126
  opts.on('-b', '--backtrace', 'Show full backtrace for all errors.') { Cucumber.use_full_backtrace = true }
@@ -131,7 +131,7 @@ module Cucumber
131
131
  opts.on('-w', '--wip', 'Fail if there are any passing scenarios.') { set_option :wip }
132
132
  opts.on('-v', '--verbose', 'Show the files and features loaded.') { set_option :verbose }
133
133
  opts.on('-g', '--guess', 'Guess best match for Ambiguous steps.') { set_option :guess }
134
- opts.on('-l', '--lines LINES', *lines_msg) {|lines| set_option :lines, lines }
134
+ opts.on('-l', '--lines LINES', *lines_msg) { |lines| set_option :lines, lines }
135
135
  opts.on('-x', '--expand', 'Expand Scenario Outline Tables in output.') { set_option :expand }
136
136
 
137
137
  opts.on('--order TYPE[:SEED]', 'Run examples in the specified order. Available types:',
@@ -351,7 +351,7 @@ TEXT
351
351
  end
352
352
 
353
353
  def require_jars(jars)
354
- Dir["#{jars}/**/*.jar"].each {|jar| require jar}
354
+ Dir["#{jars}/**/*.jar"].each { |jar| require jar }
355
355
  end
356
356
 
357
357
  def language(lang)
@@ -167,8 +167,8 @@ module Cucumber
167
167
  end
168
168
 
169
169
  def support_to_load
170
- support_files = all_files_to_load.select {|f| f =~ %r{/support/} }
171
- env_files = support_files.select {|f| f =~ %r{/support/env\..*} }
170
+ support_files = all_files_to_load.select { |f| f =~ %r{/support/} }
171
+ env_files = support_files.select { |f| f =~ %r{/support/env\..*} }
172
172
  other_files = support_files - env_files
173
173
  @options[:dry_run] ? other_files : env_files + other_files
174
174
  end
@@ -180,14 +180,14 @@ module Cucumber
180
180
  File.directory?(path) ? Dir["#{path}/**/*"] : path
181
181
  end.flatten.uniq
182
182
  remove_excluded_files_from(files)
183
- files.reject! {|f| !File.file?(f)}
184
- files.reject! {|f| File.extname(f) == '.feature' }
185
- files.reject! {|f| f =~ /^http/}
183
+ files.reject! { |f| !File.file?(f) }
184
+ files.reject! { |f| File.extname(f) == '.feature' }
185
+ files.reject! { |f| f =~ /^http/ }
186
186
  files.sort
187
187
  end
188
188
 
189
189
  def step_defs_to_load
190
- all_files_to_load.reject {|f| f =~ %r{/support/} }
190
+ all_files_to_load.reject { |f| f =~ %r{/support/} }
191
191
  end
192
192
 
193
193
  def formatter_factories
@@ -272,7 +272,7 @@ module Cucumber
272
272
  end
273
273
 
274
274
  def remove_excluded_files_from(files)
275
- files.reject! {|path| @options[:excludes].detect {|pattern| path =~ pattern } }
275
+ files.reject! { |path| @options[:excludes].detect { |pattern| path =~ pattern } }
276
276
  end
277
277
 
278
278
  def require_dirs
@@ -0,0 +1,14 @@
1
+ require 'cucumber/core/events'
2
+
3
+ module Cucumber
4
+ module Events
5
+ # Fired after we've read in the contents of a feature file
6
+ class GherkinSourceRead < Core::Event.new(:path, :body)
7
+ # The path to the file
8
+ attr_reader :path
9
+
10
+ # The raw Gherkin source
11
+ attr_reader :body
12
+ end
13
+ end
14
+ end
@@ -25,7 +25,7 @@ module Cucumber
25
25
  end
26
26
 
27
27
  def test_case_counts
28
- @test_case_counts ||= Hash.new {|h, k| h[k] = 0 }
28
+ @test_case_counts ||= Hash.new { |h, k| h[k] = 0 }
29
29
  end
30
30
  end
31
31
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cucumber
4
+ module Formatter
5
+ module AstLookup
6
+
7
+ end
8
+ end
9
+ end
@@ -111,7 +111,7 @@ module Cucumber
111
111
  # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/10655
112
112
  def linebreaks(s, max)
113
113
  return s unless max && max > 0
114
- s.gsub(/.{1,#{max}}(?:\s|\Z)/) {($& + 5.chr).gsub(/\n\005/, "\n").gsub(/\005/, "\n")}.rstrip
114
+ s.gsub(/.{1,#{max}}(?:\s|\Z)/) { ($& + 5.chr).gsub(/\n\005/, "\n").gsub(/\005/, "\n") }.rstrip
115
115
  end
116
116
 
117
117
  def collect_snippet_data(test_step, result)
@@ -182,7 +182,7 @@ module Cucumber
182
182
  end
183
183
 
184
184
  def print_messages
185
- @delayed_messages.each {|message| print_message(message)}
185
+ @delayed_messages.each { |message| print_message(message) }
186
186
  empty_messages
187
187
  end
188
188
 
@@ -464,7 +464,7 @@ module Cucumber
464
464
  end
465
465
 
466
466
  def build_step(keyword, step_match, _status)
467
- step_name = step_match.format_args(lambda {|param| %{<span class="param">#{param}</span>}})
467
+ step_name = step_match.format_args(lambda { |param| %{<span class="param">#{param}</span>} })
468
468
  builder.div(:class => 'step_name') do |div|
469
469
  builder.span(keyword, :class => 'keyword')
470
470
  builder.span(:class => 'step val') do |name|
@@ -528,11 +528,11 @@ module Cucumber
528
528
  def print_stat_string(_features)
529
529
  string = String.new
530
530
  string << dump_count(@runtime.scenarios.length, 'scenario')
531
- scenario_count = print_status_counts {|status| @runtime.scenarios(status)}
531
+ scenario_count = print_status_counts { |status| @runtime.scenarios(status) }
532
532
  string << scenario_count if scenario_count
533
533
  string << '<br />'
534
534
  string << dump_count(@runtime.steps.length, 'step')
535
- step_count = print_status_counts {|status| @runtime.steps(status)}
535
+ step_count = print_status_counts { |status| @runtime.steps(status) }
536
536
  string << step_count if step_count
537
537
  end
538
538
 
@@ -163,7 +163,7 @@ module Cucumber
163
163
  step_hash = {
164
164
  keyword: step_source.keyword,
165
165
  name: step_source.to_s,
166
- line: step_source.location.line
166
+ line: step_source.original_location.line
167
167
  }
168
168
  step_hash[:comments] = Formatter.create_comments_array(step_source.comments) unless step_source.comments.empty?
169
169
  step_hash[:doc_string] = create_doc_string_hash(step_source.multiline_arg) if step_source.multiline_arg.doc_string?
@@ -164,7 +164,7 @@ module Cucumber
164
164
  def doc_string(string)
165
165
  return if @options[:no_multiline] || @hide_this_step
166
166
  s = %{"""\n#{string}\n"""}.indent(@indent)
167
- s = s.split("\n").map {|l| l =~ /^\s+$/ ? '' : l}.join("\n")
167
+ s = s.split("\n").map { |l| l =~ /^\s+$/ ? '' : l }.join("\n")
168
168
  @io.puts(format_string(s, @current_step.status))
169
169
  @io.flush
170
170
  end
@@ -236,7 +236,7 @@ module Cucumber
236
236
  @io.print(format_string(line_comment, :comment))
237
237
  end
238
238
  @io.puts
239
- names[1..-1].each {|s| @io.puts s.to_s}
239
+ names[1..-1].each { |s| @io.puts s.to_s }
240
240
  @io.flush
241
241
  end
242
242
 
@@ -27,7 +27,7 @@ if Cucumber::WINDOWS
27
27
  o.instance_eval do
28
28
  def cucumber_preprocess_output(*a)
29
29
  begin
30
- a.map {|arg| arg.to_s.encode(Encoding.default_external)}
30
+ a.map { |arg| arg.to_s.encode(Encoding.default_external) }
31
31
  rescue Encoding::UndefinedConversionError => e
32
32
  STDERR.cucumber_puts("WARNING: #{e.message}")
33
33
  a
@@ -64,9 +64,9 @@ module Cucumber
64
64
  aggregate_info
65
65
 
66
66
  keys = if config.dry_run?
67
- @stepdef_to_match.keys.sort {|a, b| a.regexp_source <=> b.regexp_source}
67
+ @stepdef_to_match.keys.sort { |a, b| a.regexp_source <=> b.regexp_source }
68
68
  else
69
- @stepdef_to_match.keys.sort {|a, b| a.mean_duration <=> b.mean_duration}.reverse
69
+ @stepdef_to_match.keys.sort { |a, b| a.mean_duration <=> b.mean_duration }.reverse
70
70
  end
71
71
 
72
72
  keys.each do |stepdef_key|
@@ -112,7 +112,7 @@ module Cucumber
112
112
  end
113
113
 
114
114
  def max_stepdef_length
115
- @stepdef_to_match.keys.flatten.map {|key| key.regexp_source.unpack('U*').length}.max
115
+ @stepdef_to_match.keys.flatten.map { |key| key.regexp_source.unpack('U*').length }.max
116
116
  end
117
117
 
118
118
  def max_step_length
@@ -128,7 +128,7 @@ module Cucumber
128
128
  key.mean_duration = 0
129
129
  else
130
130
  key.status = worst_status(steps.map { |step| step[:status] })
131
- total_duration = steps.inject(0) {|sum, step| step[:duration] + sum}
131
+ total_duration = steps.inject(0) { |sum, step| step[:duration] + sum }
132
132
  key.mean_duration = total_duration / steps.length
133
133
  end
134
134
  end
@@ -78,11 +78,11 @@ module Cucumber
78
78
 
79
79
  ALIASES.keys.each do |key|
80
80
  define_method(key) do
81
- ALIASES[key].split(',').map {|color| COLORS[color]}.join('')
81
+ ALIASES[key].split(',').map { |color| COLORS[color] }.join('')
82
82
  end
83
83
 
84
84
  define_method("#{key}_arg") do
85
- ALIASES["#{key}_arg"].split(',').map {|color| COLORS[color]}.join('')
85
+ ALIASES["#{key}_arg"].split(',').map { |color| COLORS[color] }.join('')
86
86
  end
87
87
  end
88
88
 
@@ -135,7 +135,7 @@ module Cucumber
135
135
  end
136
136
 
137
137
  def hooks_for(phase, scenario) #:nodoc:
138
- hooks[phase.to_sym].select {|hook| scenario.accept_hook?(hook)}
138
+ hooks[phase.to_sym].select { |hook| scenario.accept_hook?(hook) }
139
139
  end
140
140
 
141
141
  def unmatched_step_definitions
@@ -175,7 +175,7 @@ module Cucumber
175
175
  end
176
176
 
177
177
  def hooks
178
- @hooks ||= Hash.new {|h, k| h[k] = []}
178
+ @hooks ||= Hash.new { |h, k| h[k] = [] }
179
179
  end
180
180
  end
181
181
 
@@ -375,7 +375,7 @@ module Cucumber
375
375
  end
376
376
 
377
377
  def has_text?(text) #:nodoc:
378
- raw.flatten.compact.detect {|cell_value| cell_value.index(text)}
378
+ raw.flatten.compact.detect { |cell_value| cell_value.index(text) }
379
379
  end
380
380
 
381
381
  def cells_rows #:nodoc:
@@ -554,7 +554,7 @@ module Cucumber
554
554
  end
555
555
 
556
556
  def width
557
- map {|cell| cell.value ? escape_cell(cell.value.to_s).unpack('U*').length : 0}.max
557
+ map { |cell| cell.value ? escape_cell(cell.value.to_s).unpack('U*').length : 0 }.max
558
558
  end
559
559
  end
560
560
 
@@ -26,7 +26,7 @@ module Cucumber
26
26
  @original_header = other_table_cell_matrix[0]
27
27
  pad_and_match
28
28
  @padded_width = cell_matrix[0].length
29
- @row_indices = Array.new(other_table_cell_matrix.length) {|n| n}
29
+ @row_indices = Array.new(other_table_cell_matrix.length) { |n| n }
30
30
  end
31
31
 
32
32
  # Pads two cell matrices to same column width and matches columns according to header value.
@@ -38,19 +38,19 @@ module Cucumber
38
38
  matched_cols = []
39
39
 
40
40
  header_values.each_with_index do |v, i|
41
- mapped_index = unmatched_cols.index {|unmapped_col| unmapped_col.first == v}
41
+ mapped_index = unmatched_cols.index { |unmapped_col| unmapped_col.first == v }
42
42
  if mapped_index
43
43
  matched_cols << unmatched_cols.delete_at(mapped_index)
44
44
  else
45
45
  mark_as_missing(cols[i])
46
- empty_col = ensure_2d(other_table_cell_matrix).collect {SurplusCell.new(nil, self, -1)}
46
+ empty_col = ensure_2d(other_table_cell_matrix).collect { SurplusCell.new(nil, self, -1) }
47
47
  empty_col.first.value = v
48
48
  matched_cols << empty_col
49
49
  end
50
50
  end
51
51
 
52
52
  unmatched_cols.each do
53
- empty_col = cell_matrix.collect {SurplusCell.new(nil, self, -1)}
53
+ empty_col = cell_matrix.collect { SurplusCell.new(nil, self, -1) }
54
54
  cols << empty_col
55
55
  end
56
56
 
@@ -76,13 +76,13 @@ module Cucumber
76
76
  changes.each do |change|
77
77
  if change.action == '-'
78
78
  @missing_row_pos = change.position + inserted
79
- cell_matrix[missing_row_pos].each {|cell| cell.status = :undefined}
79
+ cell_matrix[missing_row_pos].each { |cell| cell.status = :undefined }
80
80
  row_indices.insert(missing_row_pos, nil)
81
81
  missing += 1
82
82
  else # '+'
83
83
  @insert_row_pos = change.position + missing
84
84
  inserted_row = change.element
85
- inserted_row.each {|cell| cell.status = :comment}
85
+ inserted_row.each { |cell| cell.status = :comment }
86
86
  cell_matrix.insert(insert_row_pos, inserted_row)
87
87
  row_indices[insert_row_pos] = nil
88
88
  inspect_rows(cell_matrix[missing_row_pos], inserted_row) if last_change == '-'
@@ -121,7 +121,7 @@ module Cucumber
121
121
  end
122
122
 
123
123
  def missing_col
124
- cell_matrix[0].find {|cell| cell.status == :undefined}
124
+ cell_matrix[0].find { |cell| cell.status == :undefined }
125
125
  end
126
126
 
127
127
  def surplus_col
@@ -39,7 +39,7 @@ module Cucumber
39
39
 
40
40
  def initialize(libs, cucumber_opts, feature_files)
41
41
  raise 'libs must be an Array when running in-process' unless Array === libs
42
- libs.reverse.each {|lib| $LOAD_PATH.unshift(lib)}
42
+ libs.reverse.each { |lib| $LOAD_PATH.unshift(lib) }
43
43
  @args = (
44
44
  cucumber_opts +
45
45
  feature_files
@@ -161,7 +161,7 @@ module Cucumber
161
161
  end
162
162
 
163
163
  def cucumber_opts_with_profile #:nodoc:
164
- Array(cucumber_opts).concat Array(@profile).flat_map {|p| ['--profile', p] }
164
+ Array(cucumber_opts).concat Array(@profile).flat_map { |p| ['--profile', p] }
165
165
  end
166
166
 
167
167
  def feature_files #:nodoc:
@@ -169,7 +169,7 @@ module Cucumber
169
169
  end
170
170
 
171
171
  def make_command_line_safe(list)
172
- list.map {|string| string.gsub(' ', '\ ')}
172
+ list.map { |string| string.gsub(' ', '\ ') }
173
173
  end
174
174
  end
175
175
  end
@@ -273,7 +273,7 @@ module Cucumber
273
273
  end
274
274
 
275
275
  def install_wire_plugin
276
- Cucumber::Wire::Plugin.new(@configuration).install if @configuration.all_files_to_load.any? {|f| f =~ %r{\.wire$} }
276
+ Cucumber::Wire::Plugin.new(@configuration).install if @configuration.all_files_to_load.any? { |f| f =~ %r{\.wire$} }
277
277
  end
278
278
 
279
279
  def log
@@ -46,7 +46,7 @@ module Cucumber
46
46
  #
47
47
  # lambda { |param| "[#{param}]" }
48
48
  #
49
- def format_args(format = lambda {|a| a}, &proc)
49
+ def format_args(format = lambda { |a| a }, &proc)
50
50
  replace_arguments(@name_to_match, @step_arguments, format, &proc)
51
51
  end
52
52
 
@@ -35,16 +35,16 @@ module Cucumber
35
35
  private
36
36
 
37
37
  def best_matches(_step_name, step_matches) #:nodoc:
38
- no_groups = step_matches.select {|step_match| step_match.args.empty?}
39
- max_arg_length = step_matches.map {|step_match| step_match.args.length }.max
40
- top_groups = step_matches.select {|step_match| step_match.args.length == max_arg_length }
38
+ no_groups = step_matches.select { |step_match| step_match.args.empty? }
39
+ max_arg_length = step_matches.map { |step_match| step_match.args.length }.max
40
+ top_groups = step_matches.select { |step_match| step_match.args.length == max_arg_length }
41
41
 
42
42
  if no_groups.any?
43
43
  longest_regexp_length = no_groups.map(&:text_length).max
44
- no_groups.select {|step_match| step_match.text_length == longest_regexp_length }
44
+ no_groups.select { |step_match| step_match.text_length == longest_regexp_length }
45
45
  elsif top_groups.any?
46
- shortest_capture_length = top_groups.map {|step_match| step_match.args.inject(0) {|sum, c| sum + c.to_s.length } }.min
47
- top_groups.select {|step_match| step_match.args.inject(0) {|sum, c| sum + c.to_s.length } == shortest_capture_length }
46
+ shortest_capture_length = top_groups.map { |step_match| step_match.args.inject(0) { |sum, c| sum + c.to_s.length } }.min
47
+ top_groups.select { |step_match| step_match.args.inject(0) { |sum, c| sum + c.to_s.length } == shortest_capture_length }
48
48
  else
49
49
  top_groups
50
50
  end
@@ -1 +1 @@
1
- 3.1.1
1
+ 3.1.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-06-03 00:00:00.000000000 Z
13
+ date: 2018-07-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: builder
@@ -32,28 +32,28 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 3.1.0
35
+ version: 3.2.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 3.1.0
42
+ version: 3.2.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: cucumber-expressions
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 6.0.0
49
+ version: 6.0.1
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: 6.0.0
56
+ version: 6.0.1
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: cucumber-wire
59
59
  requirement: !ruby/object:Gem::Requirement
@@ -345,6 +345,7 @@ files:
345
345
  - lib/cucumber/encoding.rb
346
346
  - lib/cucumber/errors.rb
347
347
  - lib/cucumber/events.rb
348
+ - lib/cucumber/events/gherkin_source_parsed.rb~
348
349
  - lib/cucumber/events/gherkin_source_read.rb
349
350
  - lib/cucumber/events/step_activated.rb
350
351
  - lib/cucumber/events/step_definition_registered.rb
@@ -371,6 +372,7 @@ files:
371
372
  - lib/cucumber/filters/tag_limits/test_case_index.rb
372
373
  - lib/cucumber/filters/tag_limits/verifier.rb
373
374
  - lib/cucumber/formatter/ansicolor.rb
375
+ - lib/cucumber/formatter/ast_lookup.rb~
374
376
  - lib/cucumber/formatter/backtrace_filter.rb
375
377
  - lib/cucumber/formatter/console.rb
376
378
  - lib/cucumber/formatter/console_counts.rb
@@ -466,8 +468,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
466
468
  version: '0'
467
469
  requirements: []
468
470
  rubyforge_project:
469
- rubygems_version: 2.6.13
471
+ rubygems_version: 2.5.2
470
472
  signing_key:
471
473
  specification_version: 4
472
- summary: cucumber-3.1.1
474
+ summary: cucumber-3.1.2
473
475
  test_files: []