cucumber 7.1.0 → 8.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +79 -1
  3. data/CONTRIBUTING.md +2 -6
  4. data/README.md +4 -7
  5. data/lib/autotest/cucumber_mixin.rb +5 -2
  6. data/lib/autotest/discover.rb +3 -2
  7. data/lib/cucumber/cli/configuration.rb +4 -1
  8. data/lib/cucumber/cli/main.rb +4 -3
  9. data/lib/cucumber/cli/options.rb +8 -2
  10. data/lib/cucumber/cli/profile_loader.rb +1 -5
  11. data/lib/cucumber/cli/rerun_file.rb +1 -1
  12. data/lib/cucumber/configuration.rb +5 -4
  13. data/lib/cucumber/constantize.rb +1 -1
  14. data/lib/cucumber/deprecate.rb +2 -1
  15. data/lib/cucumber/errors.rb +1 -1
  16. data/lib/cucumber/events/hook_test_step_created.rb +1 -2
  17. data/lib/cucumber/events/step_activated.rb +0 -6
  18. data/lib/cucumber/events/step_definition_registered.rb +0 -5
  19. data/lib/cucumber/events/test_case_created.rb +1 -2
  20. data/lib/cucumber/events/test_run_finished.rb +2 -1
  21. data/lib/cucumber/events/test_step_created.rb +1 -2
  22. data/lib/cucumber/events/undefined_parameter_type.rb +1 -2
  23. data/lib/cucumber/events.rb +1 -1
  24. data/lib/cucumber/file_specs.rb +2 -1
  25. data/lib/cucumber/filters/activate_steps.rb +1 -0
  26. data/lib/cucumber/filters/tag_limits/verifier.rb +1 -3
  27. data/lib/cucumber/filters/tag_limits.rb +1 -3
  28. data/lib/cucumber/formatter/ansicolor.rb +63 -63
  29. data/lib/cucumber/formatter/ast_lookup.rb +2 -2
  30. data/lib/cucumber/formatter/backtrace_filter.rb +1 -1
  31. data/lib/cucumber/formatter/console.rb +10 -2
  32. data/lib/cucumber/formatter/console_issues.rb +6 -1
  33. data/lib/cucumber/formatter/duration_extractor.rb +1 -0
  34. data/lib/cucumber/formatter/errors.rb +1 -0
  35. data/lib/cucumber/formatter/fanout.rb +1 -1
  36. data/lib/cucumber/formatter/http_io.rb +6 -1
  37. data/lib/cucumber/formatter/ignore_missing_messages.rb +1 -1
  38. data/lib/cucumber/formatter/io.rb +3 -1
  39. data/lib/cucumber/formatter/json.rb +8 -6
  40. data/lib/cucumber/formatter/junit.rb +6 -3
  41. data/lib/cucumber/formatter/message_builder.rb +3 -2
  42. data/lib/cucumber/formatter/pretty.rb +15 -5
  43. data/lib/cucumber/formatter/progress.rb +1 -0
  44. data/lib/cucumber/formatter/query/hook_by_test_step.rb +1 -0
  45. data/lib/cucumber/formatter/query/test_case_started_by_test_case.rb +2 -0
  46. data/lib/cucumber/formatter/rerun.rb +2 -0
  47. data/lib/cucumber/formatter/summary.rb +1 -0
  48. data/lib/cucumber/formatter/unicode.rb +4 -4
  49. data/lib/cucumber/formatter/usage.rb +3 -3
  50. data/lib/cucumber/gherkin/data_table_parser.rb +1 -0
  51. data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +2 -2
  52. data/lib/cucumber/glue/dsl.rb +4 -9
  53. data/lib/cucumber/glue/hook.rb +2 -1
  54. data/lib/cucumber/glue/invoke_in_world.rb +4 -4
  55. data/lib/cucumber/glue/proto_world.rb +10 -9
  56. data/lib/cucumber/glue/registry_and_more.rb +4 -18
  57. data/lib/cucumber/glue/step_definition.rb +6 -3
  58. data/lib/cucumber/hooks.rb +1 -0
  59. data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +2 -1
  60. data/lib/cucumber/multiline_argument/data_table.rb +58 -71
  61. data/lib/cucumber/platform.rb +2 -2
  62. data/lib/cucumber/rake/task.rb +10 -7
  63. data/lib/cucumber/rspec/disable_option_parser.rb +6 -3
  64. data/lib/cucumber/running_test_case.rb +1 -0
  65. data/lib/cucumber/runtime/meta_message_builder.rb +106 -0
  66. data/lib/cucumber/runtime/support_code.rb +3 -0
  67. data/lib/cucumber/runtime/user_interface.rb +5 -4
  68. data/lib/cucumber/runtime.rb +21 -37
  69. data/lib/cucumber/step_match.rb +5 -3
  70. data/lib/cucumber/step_match_search.rb +3 -2
  71. data/lib/cucumber/term/ansicolor.rb +74 -50
  72. data/lib/cucumber/term/banner.rb +1 -0
  73. data/lib/cucumber/version +1 -1
  74. data/lib/cucumber.rb +2 -1
  75. data/lib/simplecov_setup.rb +1 -1
  76. metadata +74 -73
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f93e3cad9c408e1d22f274d24602251d1a1160e7a9438f4a8efeff9d77065978
4
- data.tar.gz: 8f963ac7a227bd73cc4177024825731788d47049f3fbe383d3051831eba4b0c8
3
+ metadata.gz: e32ea19a07706080d0618aa312bed39896bba31c55a4200ebc59ce6fa45368b6
4
+ data.tar.gz: 3b9acd63b9ef900593a1ca46bba104030e3de6e5eca8f48f9eaf8c2c39b2bbfd
5
5
  SHA512:
6
- metadata.gz: 2f8f88993561639861f542d90b09e46a7686d20ffadc690b6e310e8b6559f6f025647af8efed7683ccaf44932275cfcf1e68af9e2e26ecb9957d1fd32af317d1
7
- data.tar.gz: e2ea746319ad640a04789974c66bc6e2d14abfbbf7d7d6f5e3412e2c1b7318a54f938a58aa140cd6d5739fd4107844c235e312daaaa29506f3fa449d81115ce7
6
+ metadata.gz: 6d8b54a8196149ffbc2cf87d7d150ced53ed02fdfe6228ffc407d763301d6e0c0aee97544ee49b7cb3cb990716617082b886cfea184ada2c3576e8e65c0b9af1
7
+ data.tar.gz: 19c14443cf48f81e4d74eb8864c92a625e912adf516394f5e5bb394d1b838fb96c04c4398aa643cfd2e12367e32354142c12a11ccb3c0d44c493e178d80b1c5f
data/CHANGELOG.md CHANGED
@@ -10,7 +10,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
10
10
 
11
11
  ---
12
12
 
13
- ## [Unreleased](https://github.com/cucumber/cucumber-ruby/compare/v7.1.0...main)
13
+ ## [Unreleased](https://github.com/cucumber/cucumber-ruby/compare/v8.0.0.rc.1...main)
14
14
 
15
15
  ### Added
16
16
 
@@ -24,6 +24,84 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
24
24
 
25
25
  ### Deprecated
26
26
 
27
+ ### Dependencies
28
+
29
+ ## [8.0.0.RC.1](https://github.com/cucumber/cucumber-ruby/compare/v7.1.0...v8.0.0.rc.1)
30
+
31
+ ### Fixed
32
+
33
+ - Fix TestRunFinished success property in html formatter and all formatters
34
+ based on the messages: it now returns true if the run has passed
35
+ ([PR#1606](https://github.com/cucumber/cucumber-ruby/pull/1606)
36
+ [Issue#1604](https://github.com/cucumber/cucumber-ruby/issues/1604))
37
+
38
+ - Fix usage of namespaced modules across multiple scenarios
39
+ ([PR#1603](https://github.com/cucumber/cucumber-ruby/pull/1603)
40
+ [Issue#1595](https://github.com/cucumber/cucumber-ruby/issues/1595))
41
+
42
+ - Do not serialize Messages::Hook#tag_expression if it is empty.
43
+ ([PR#1579](https://github.com/cucumber/cucumber-ruby/pull/1579))
44
+
45
+ - JSON Formatter uses "pretty" output format
46
+ ([PR#1580](https://github.com/cucumber/cucumber-ruby/pull/1580))
47
+
48
+ - Fixed JSON Formatter "end of background" detection.
49
+ ([PR#1580](https://github.com/cucumber/cucumber-ruby/pull/1580))
50
+
51
+ - Fixed JSON Formatter expansion of Scenario Outline templates in Doc Strings.
52
+ ([PR#1580](https://github.com/cucumber/cucumber-ruby/pull/1580))
53
+
54
+ - Removed usage of `eval` in `Cucumber::Term::ANSIColor` and `Cucumber::Formatter::ANSIColor`.
55
+ ([PR#1589](https://github.com/cucumber/cucumber-ruby/pull/1589)
56
+ [Issue#1583](https://github.com/cucumber/cucumber-ruby/issues/1583))
57
+
58
+ - Fixed `DataTable#map_headers` when headers have the same prefix.
59
+ ([PR#1598](https://github.com/cucumber/cucumber-ruby/pull/1598)
60
+ [Issue#1450](https://github.com/cucumber/cucumber-ruby/issues/1450))
61
+
62
+ ### Changed
63
+
64
+ - Replace dependency [cucumber-create-meta](https://rubygems.org/gems/cucumber-create-meta)
65
+ with the new [cucumber-ci-environment](https://rubygems.org/gems/cucumber-ci-environment)
66
+ ([PR#1601](https://github.com/cucumber/cucumber-ruby/pull/1601))
67
+
68
+ - In `DataTable#map_column`, Changed the `strict` argument into a keyword argument.
69
+ See [UPGRADING.md](./UPGRADING.md#upgrading-to-800).
70
+ ([PR#1594](https://github.com/cucumber/cucumber-ruby/pull/1594)
71
+ [Issue#1592](https://github.com/cucumber/cucumber-ruby/issues/1592))
72
+
73
+ - Added Ruby 3.1
74
+ ([PR#1607](https://github.com/cucumber/cucumber-ruby/pull/1607))
75
+
76
+ ### Removed
77
+
78
+ - `AfterConfiguration` has been removed. Please use `InstallPlugin` or `BeforeAll` instead.
79
+ See the [UPGRADING.md](./UPGRADING.md#upgrading-to-800) to update your code accordingly.
80
+ ([PR#1591](https://github.com/cucumber/cucumber-ruby/pull/1591))
81
+
82
+ - The built-in Wire protocol
83
+ The Wire protocol is still officially supported, but as an optional plugin rather
84
+ than a built-in feature. See the
85
+ [UPGRADING.md](./UPGRADING.md#upgrading-to-800)
86
+ to update your code accordingly.
87
+
88
+ ([1562](https://github.com/cucumber/cucumber-ruby/pull/1562)
89
+ [aurelien-reeves](https://github.com/aurelien-reeves))
90
+
91
+ - Removed former unused `stdin` argument from `Cli::Main`. That may impact your code
92
+ if you use cucumber API `Cucumber::Cli::Main`. See [UPGRADING.md](./UPGRADING.md#upgrading-to-800).
93
+ ([PR#1588](https://github.com/cucumber/cucumber-ruby/pull/1588)
94
+ [Issue#1581](https://github.com/cucumber/cucumber-ruby/issues/1581))
95
+
96
+ - Removed `DataTable#map_column!` and `DataTable#map_headers!`.
97
+ Those methods were error-prone and planned to be removed a long time ago. You
98
+ can use the immutable versions instead: `DataTable#map_column` and
99
+ `DataTable#map_headers`.
100
+ ([PR#1590](https://github.com/cucumber/cucumber-ruby/pull/1590)
101
+ [Issue#1584](https://github.com/cucumber/cucumber-ruby/issues/1584))
102
+
103
+ - Removed support for Ruby 2.5 and JRuby 9.2.
104
+
27
105
  ## [7.1.0](https://github.com/cucumber/cucumber-ruby/compare/v7.0.0...v7.1.0) (2021-10-12)
28
106
 
29
107
  ### Added
data/CONTRIBUTING.md CHANGED
@@ -83,11 +83,8 @@ with a lot of libraries. You will find there what is related to:
83
83
  step definition
84
84
  - everyting related to the HTML formatter
85
85
 
86
- `cucumber-ruby` is also composed of:
87
-
88
- - [cucumber-ruby-core]: this is the engine that will execute the test cases
89
- computed from a parsed Gherkin document
90
- - [cucumber-ruby-wire]: everything related to the Cucumber's wire protocol
86
+ `cucumber-ruby` is also composed of [cucumber-ruby-core]: this is the engine that
87
+ will execute the test cases computed from a parsed Gherkin document
91
88
 
92
89
  Last but not least, there is also a repository for [cucumber-rails], the gem
93
90
  that brings Cucumber to Rails 5.x and 6.x.
@@ -236,7 +233,6 @@ You can find additional documentation in the [docs](./docs) directory such as
236
233
  [cucumber-docs]: https://cucumber.io/docs/cucumber
237
234
  [cucumber/common]: https://github.com/cucumber/common
238
235
  [cucumber-ruby-core]: https://github.com/cucumber/cucumber-ruby-core
239
- [cucumber-ruby-wire]: https://github.com/cucumber/cucumber-ruby-wire
240
236
  [cucumber-rails]: https://github.com/cucumber/cucumber-rails
241
237
  [cucumber-ruby-issues]: https://github.com/cucumber/cucumber-ruby/search?q=is%3Aissue
242
238
  [cucumber/common-issues]: https://github.com/cucumber/common/search?q=is%3Aissue
data/README.md CHANGED
@@ -50,16 +50,13 @@ Later in this document, bundler is considered being used so all commands are usi
50
50
 
51
51
  ### Supported platforms
52
52
 
53
+ - Ruby 3.1
53
54
  - Ruby 3.0
54
55
  - Ruby 2.7
55
56
  - Ruby 2.6
56
- - Ruby 2.5
57
- - Ruby 2.4
58
- - Ruby 2.3
59
- - JRuby 9.2 (with [some limitations](https://github.com/cucumber/cucumber-ruby/blob/main/docs/jruby-limitations.md))
60
-
61
- JRuby 9.3 is not supported yet due to a known issue. More info can
62
- be found in the [PR#1571](https://github.com/cucumber/cucumber-ruby/pull/1571).
57
+ - JRuby (with [some limitations](https://github.com/cucumber/cucumber-ruby/blob/main/docs/jruby-limitations.md))
58
+ - 9.3 >= 9.3.1 (there is a known issue with JRuby 9.3.0. More info can
59
+ be found in the [PR#1571](https://github.com/cucumber/cucumber-ruby/pull/1571).)
63
60
 
64
61
  ### Ruby on Rails
65
62
 
@@ -24,7 +24,7 @@ module Autotest::CucumberMixin
24
24
  add_sigint_handler
25
25
 
26
26
  loop do # ^c handler
27
- get_to_green
27
+ wait_for_green
28
28
  if tainted
29
29
  rerun_all_tests
30
30
  rerun_all_features if all_good
@@ -37,6 +37,7 @@ module Autotest::CucumberMixin
37
37
  reset_features
38
38
  rescue Interrupt
39
39
  break if wants_to_quit
40
+
40
41
  reset
41
42
  reset_features
42
43
  end
@@ -47,7 +48,7 @@ module Autotest::CucumberMixin
47
48
  features_to_run == ''
48
49
  end
49
50
 
50
- def get_to_green # rubocop:disable Naming/AccessorMethodName
51
+ def wait_for_green
51
52
  loop do
52
53
  super
53
54
  run_features
@@ -70,6 +71,7 @@ module Autotest::CucumberMixin
70
71
  Tempfile.open('autotest-cucumber') do |dirty_features_file|
71
72
  cmd = make_cucumber_cmd(features_to_run, dirty_features_file.path)
72
73
  break if cmd.empty?
74
+
73
75
  old_sync = $stdout.sync
74
76
  $stdout.sync = true
75
77
  self.results = []
@@ -81,6 +83,7 @@ module Autotest::CucumberMixin
81
83
  print(c)
82
84
  line << c
83
85
  next unless c == "\n"
86
+
84
87
  results << line.join
85
88
  line.clear
86
89
  end
@@ -2,9 +2,10 @@
2
2
 
3
3
  Autotest.add_discovery do
4
4
  if File.directory?('features')
5
- if ENV['AUTOFEATURE'] =~ /true/i
5
+ case ENV['AUTOFEATURE']
6
+ when /true/i
6
7
  'cucumber'
7
- elsif ENV['AUTOFEATURE'] =~ /false/i
8
+ when /false/i
8
9
  # noop
9
10
  else
10
11
  puts '(Not running features. To run features in autotest, set AUTOFEATURE=true.)'
@@ -9,7 +9,9 @@ require 'cucumber'
9
9
  module Cucumber
10
10
  module Cli
11
11
  class YmlLoadError < StandardError; end
12
+
12
13
  class ProfilesNotDefinedError < YmlLoadError; end
14
+
13
15
  class ProfileNotFound < StandardError; end
14
16
 
15
17
  class Configuration
@@ -17,7 +19,7 @@ module Cucumber
17
19
 
18
20
  attr_reader :out_stream
19
21
 
20
- def initialize(out_stream = STDOUT, error_stream = STDERR)
22
+ def initialize(out_stream = $stdout, error_stream = $stderr)
21
23
  @out_stream = out_stream
22
24
  @error_stream = error_stream
23
25
  @options = Options.new(@out_stream, @error_stream, default_profile: 'default')
@@ -28,6 +30,7 @@ module Cucumber
28
30
  @options.parse!(args)
29
31
  arrange_formats
30
32
  raise("You can't use both --strict and --wip") if strict.strict? && wip?
33
+
31
34
  set_environment_variables
32
35
  end
33
36
 
@@ -14,7 +14,7 @@ module Cucumber
14
14
  end
15
15
  end
16
16
 
17
- def initialize(args, _ = nil, out = STDOUT, err = STDERR, kernel = Kernel)
17
+ def initialize(args, out = $stdout, err = $stderr, kernel = Kernel)
18
18
  @args = args
19
19
  @out = out
20
20
  @err = err
@@ -41,7 +41,7 @@ module Cucumber
41
41
  @err.puts("Couldn't open #{e.path}")
42
42
  exit_unable_to_finish
43
43
  rescue FeatureFolderNotFoundException => e
44
- @err.puts(e.message + '. You can use `cucumber --init` to get started.')
44
+ @err.puts("#{e.message}. You can use `cucumber --init` to get started.")
45
45
  exit_unable_to_finish
46
46
  rescue ProfilesNotDefinedError, YmlLoadError, ProfileNotFound => e
47
47
  @err.puts(e.message)
@@ -85,13 +85,14 @@ module Cucumber
85
85
  trap('INT') do
86
86
  exit_unable_to_finish! if Cucumber.wants_to_quit
87
87
  Cucumber.wants_to_quit = true
88
- STDERR.puts "\nExiting... Interrupt again to exit immediately."
88
+ $stderr.puts "\nExiting... Interrupt again to exit immediately."
89
89
  exit_unable_to_finish
90
90
  end
91
91
  end
92
92
 
93
93
  def runtime(existing_runtime)
94
94
  return Runtime.new(configuration) unless existing_runtime
95
+
95
96
  existing_runtime.configure(configuration)
96
97
  existing_runtime
97
98
  end
@@ -63,13 +63,13 @@ module Cucumber
63
63
  '--lines', '--port', '-I', '--snippet-type'
64
64
  ].freeze
65
65
  ORDER_TYPES = %w[defined random].freeze
66
- TAG_LIMIT_MATCHER = /(?<tag_name>\@\w+):(?<limit>\d+)/x
66
+ TAG_LIMIT_MATCHER = /(?<tag_name>@\w+):(?<limit>\d+)/x
67
67
 
68
68
  def self.parse(args, out_stream, error_stream, options = {})
69
69
  new(out_stream, error_stream, options).parse!(args)
70
70
  end
71
71
 
72
- def initialize(out_stream = STDOUT, error_stream = STDERR, options = {})
72
+ def initialize(out_stream = $stdout, error_stream = $stderr, options = {})
73
73
  @out_stream = out_stream
74
74
  @error_stream = error_stream
75
75
 
@@ -180,6 +180,7 @@ Specify SEED to reproduce the shuffling from a previous run.
180
180
  def check_formatter_stream_conflicts
181
181
  streams = @options[:formats].uniq.map { |(_, _, stream)| stream }
182
182
  return if streams == streams.uniq
183
+
183
184
  raise 'All but one formatter must use --out, only one can print to each stream (or STDOUT)'
184
185
  end
185
186
 
@@ -203,6 +204,7 @@ Specify SEED to reproduce the shuffling from a previous run.
203
204
 
204
205
  def truthy_string?(str)
205
206
  return false if str.nil?
207
+
206
208
  str !~ /^(false|no|0)$/i
207
209
  end
208
210
 
@@ -367,6 +369,7 @@ Specify SEED to reproduce the shuffling from a previous run.
367
369
  def require_files(v)
368
370
  @options[:require] << v
369
371
  return unless Cucumber::JRUBY && File.directory?(v)
372
+
370
373
  require 'java'
371
374
  $CLASSPATH << v
372
375
  end
@@ -385,6 +388,7 @@ Specify SEED to reproduce the shuffling from a previous run.
385
388
  require 'gherkin/dialect'
386
389
 
387
390
  return indicate_invalid_language_and_exit(lang) unless ::Gherkin::DIALECTS.key?(lang)
391
+
388
392
  list_keywords_and_exit(lang)
389
393
  end
390
394
 
@@ -403,6 +407,7 @@ Specify SEED to reproduce the shuffling from a previous run.
403
407
  def add_tag(value)
404
408
  raise("Found tags option '#{value}'. '~@tag' is no longer supported, use 'not @tag' instead.") if value.include?('~')
405
409
  raise("Found tags option '#{value}'. '@tag1,@tag2' is no longer supported, use '@tag or @tag2' instead.") if value.include?(',')
410
+
406
411
  @options[:tag_expressions] << value.gsub(/(@\w+)(:\d+)?/, '\1')
407
412
  add_tag_limits(value)
408
413
  end
@@ -415,6 +420,7 @@ Specify SEED to reproduce the shuffling from a previous run.
415
420
 
416
421
  def add_tag_limit(tag_limits, tag_name, limit)
417
422
  raise "Inconsistent tag limits for #{tag_name}: #{tag_limits[tag_name]} and #{limit}" if tag_limits[tag_name] && tag_limits[tag_name] != limit
423
+
418
424
  tag_limits[tag_name] = limit
419
425
  end
420
426
 
@@ -75,11 +75,7 @@ Defined profiles in cucumber.yml:
75
75
  def process_configuration_file_with_erb
76
76
  require 'erb'
77
77
  begin
78
- @cucumber_erb = if RUBY_VERSION >= '2.6'
79
- ERB.new(IO.read(cucumber_file), trim_mode: '%').result(binding)
80
- else
81
- ERB.new(IO.read(cucumber_file), nil, '%').result(binding)
82
- end
78
+ @cucumber_erb = ERB.new(IO.read(cucumber_file), trim_mode: '%').result(binding)
83
79
  rescue StandardError
84
80
  raise(YmlLoadError, "cucumber.yml was found, but could not be parsed with ERB. Please refer to cucumber's documentation on correct profile usage.\n#{$ERROR_INFO.inspect}")
85
81
  end
@@ -10,7 +10,7 @@ module Cucumber
10
10
  end
11
11
 
12
12
  def self.real_path(path)
13
- path[1..-1] # remove leading @
13
+ path[1..]
14
14
  end
15
15
 
16
16
  def initialize(path)
@@ -176,12 +176,12 @@ module Cucumber
176
176
  end
177
177
 
178
178
  def support_to_load
179
- support_files = all_files_to_load.select { |f| f =~ %r{/support/} }
179
+ support_files = all_files_to_load.select { |f| f =~ /\/support\// }
180
180
 
181
181
  # env_files are separated from other_files so we can ensure env files
182
182
  # load first.
183
183
  #
184
- env_files = support_files.select { |f| f =~ %r{/support/env\..*} }
184
+ env_files = support_files.select { |f| f =~ /\/support\/env\..*/ }
185
185
  other_files = support_files - env_files
186
186
  env_files.reverse + other_files.reverse
187
187
  end
@@ -189,7 +189,7 @@ module Cucumber
189
189
  def all_files_to_load
190
190
  files = require_dirs.map do |path|
191
191
  path = path.tr('\\', '/') # In case we're on windows. Globs don't work with backslashes.
192
- path = path.gsub(/\/$/, '') # Strip trailing slash. # rubocop:disable Style/RegexpLiteral
192
+ path = path.gsub(/\/$/, '') # Strip trailing slash.
193
193
  File.directory?(path) ? Dir["#{path}/**/*"] : path
194
194
  end.flatten.uniq
195
195
  remove_excluded_files_from(files)
@@ -200,7 +200,7 @@ module Cucumber
200
200
  end
201
201
 
202
202
  def step_defs_to_load
203
- all_files_to_load.reject { |f| f =~ %r{/support/} }
203
+ all_files_to_load.reject { |f| f =~ /\/support\// }
204
204
  end
205
205
 
206
206
  def formatter_factories
@@ -283,6 +283,7 @@ module Cucumber
283
283
 
284
284
  def with_default_features_path(paths)
285
285
  return default_features_paths if paths.empty?
286
+
286
287
  paths
287
288
  end
288
289
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'cucumber/platform'
4
4
  module Cucumber
5
- module Constantize #:nodoc:
5
+ module Constantize # :nodoc:
6
6
  def constantize(camel_cased_word)
7
7
  try = 0
8
8
  begin
@@ -20,6 +20,7 @@ module Cucumber
20
20
  class CliOption
21
21
  def self.deprecate(stream, option, message, remove_after_version)
22
22
  return if stream.nil?
23
+
23
24
  stream.puts(
24
25
  AnsiString.failure_message(
25
26
  "\nWARNING: #{option} is deprecated" \
@@ -31,7 +32,7 @@ module Cucumber
31
32
 
32
33
  module ForUsers
33
34
  def self.call(message, method, remove_after_version)
34
- STDERR.puts AnsiString.failure_message(
35
+ $stderr.puts AnsiString.failure_message(
35
36
  "\nWARNING: ##{method} is deprecated" \
36
37
  " and will be removed after version #{remove_after_version}. #{message}.\n" \
37
38
  "(Called from #{caller(3..3).first})"
@@ -9,7 +9,7 @@ module Cucumber
9
9
  return result.with_message(with_prefix(result.message)) if result.is_a?(self)
10
10
 
11
11
  begin
12
- raise new(with_prefix(step_name)) # rubocop:disable Style/RaiseArgs
12
+ raise self, with_prefix(step_name)
13
13
  rescue StandardError => e
14
14
  e
15
15
  end
@@ -6,8 +6,7 @@ module Cucumber
6
6
  module Events
7
7
  # Event fired when a step is created from a hook
8
8
  class HookTestStepCreated < Core::Event.new(:test_step, :hook)
9
- attr_reader :test_step
10
- attr_reader :hook
9
+ attr_reader :test_step, :hook
11
10
  end
12
11
  end
13
12
  end
@@ -15,12 +15,6 @@ module Cucumber
15
15
  #
16
16
  # @return [Cucumber::StepMatch]
17
17
  attr_reader :step_match
18
-
19
- # @private
20
- def initialize(test_step, step_match)
21
- @test_step = test_step
22
- @step_match = step_match
23
- end
24
18
  end
25
19
  end
26
20
  end
@@ -10,11 +10,6 @@ module Cucumber
10
10
  #
11
11
  # @return [RbSupport::RbStepDefinition]
12
12
  attr_reader :step_definition
13
-
14
- # _@private
15
- def initialize(step_definition)
16
- @step_definition = step_definition
17
- end
18
13
  end
19
14
  end
20
15
  end
@@ -6,8 +6,7 @@ module Cucumber
6
6
  module Events
7
7
  # Event fired when a Test::Case is created from a Pickle
8
8
  class TestCaseCreated < Core::Event.new(:test_case, :pickle)
9
- attr_reader :test_case
10
- attr_reader :pickle
9
+ attr_reader :test_case, :pickle
11
10
  end
12
11
  end
13
12
  end
@@ -5,7 +5,8 @@ require 'cucumber/core/events'
5
5
  module Cucumber
6
6
  module Events
7
7
  # Event fired after all test cases have finished executing
8
- class TestRunFinished < Core::Event.new
8
+ class TestRunFinished < Core::Event.new(:success)
9
+ attr_reader :success
9
10
  end
10
11
  end
11
12
  end
@@ -6,8 +6,7 @@ module Cucumber
6
6
  module Events
7
7
  # Event fired when a TestStep is created from a PickleStep
8
8
  class TestStepCreated < Core::Event.new(:test_step, :pickle_step)
9
- attr_reader :test_step
10
- attr_reader :pickle_step
9
+ attr_reader :test_step, :pickle_step
11
10
  end
12
11
  end
13
12
  end
@@ -3,8 +3,7 @@ require 'cucumber/core/events'
3
3
  module Cucumber
4
4
  module Events
5
5
  class UndefinedParameterType < Core::Event.new(:type_name, :expression)
6
- attr_reader :type_name
7
- attr_reader :expression
6
+ attr_reader :type_name, :expression
8
7
  end
9
8
  end
10
9
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Dir[File.dirname(__FILE__) + '/events/*.rb'].map(&method(:require))
3
+ Dir["#{File.dirname(__FILE__)}/events/*.rb"].map(&method(:require))
4
4
 
5
5
  module Cucumber
6
6
  # Events tell you what's happening while Cucumber runs your features.
@@ -5,7 +5,7 @@ require 'cucumber/core/test/location'
5
5
 
6
6
  module Cucumber
7
7
  class FileSpecs
8
- FILE_COLON_LINE_PATTERN = /^([\w\W]*?)(?::([\d:]+))?$/ #:nodoc:
8
+ FILE_COLON_LINE_PATTERN = /^([\w\W]*?)(?::([\d:]+))?$/ # :nodoc:
9
9
 
10
10
  def initialize(file_specs)
11
11
  Cucumber.logger.debug("Features:\n")
@@ -32,6 +32,7 @@ module Cucumber
32
32
 
33
33
  def locations
34
34
  return [Core::Test::Location.new(@file)] if @lines.empty?
35
+
35
36
  @lines.map { |line| Core::Test::Location.new(@file, line) }
36
37
  end
37
38
  end
@@ -52,6 +52,7 @@ module Cucumber
52
52
  end
53
53
  configuration.notify :step_activated, test_step, match
54
54
  return SkippingStepMatch.new if configuration.dry_run?
55
+
55
56
  match
56
57
  end
57
58
 
@@ -47,9 +47,7 @@ module Cucumber
47
47
  locations.count
48
48
  end
49
49
 
50
- attr_reader :tag_name
51
- attr_reader :limit
52
- attr_reader :locations
50
+ attr_reader :tag_name, :limit, :locations
53
51
  end
54
52
  end
55
53
  end
@@ -38,9 +38,7 @@ module Cucumber
38
38
 
39
39
  private
40
40
 
41
- attr_reader :gated_receiver
42
- attr_reader :test_case_index
43
- attr_reader :verifier
41
+ attr_reader :gated_receiver, :test_case_index, :verifier
44
42
  end
45
43
  end
46
44
  end