cucumber 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -2
  3. data/CONTRIBUTING.md +1 -0
  4. data/README.md +6 -7
  5. data/lib/autotest/cucumber.rb +1 -0
  6. data/lib/autotest/cucumber_mixin.rb +1 -0
  7. data/lib/autotest/cucumber_rails.rb +1 -0
  8. data/lib/autotest/cucumber_rails_rspec.rb +1 -0
  9. data/lib/autotest/cucumber_rails_rspec2.rb +1 -0
  10. data/lib/autotest/cucumber_rspec.rb +1 -0
  11. data/lib/autotest/cucumber_rspec2.rb +1 -0
  12. data/lib/autotest/discover.rb +1 -0
  13. data/lib/cucumber.rb +1 -0
  14. data/lib/cucumber/cli/configuration.rb +1 -0
  15. data/lib/cucumber/cli/main.rb +2 -2
  16. data/lib/cucumber/cli/options.rb +42 -40
  17. data/lib/cucumber/cli/profile_loader.rb +5 -7
  18. data/lib/cucumber/cli/rerun_file.rb +1 -0
  19. data/lib/cucumber/configuration.rb +1 -0
  20. data/lib/cucumber/constantize.rb +6 -5
  21. data/lib/cucumber/core_ext/string.rb +1 -0
  22. data/lib/cucumber/deprecate.rb +1 -1
  23. data/lib/cucumber/encoding.rb +2 -1
  24. data/lib/cucumber/errors.rb +1 -0
  25. data/lib/cucumber/events.rb +1 -1
  26. data/lib/cucumber/events/gherkin_source_read.rb +1 -4
  27. data/lib/cucumber/events/step_activated.rb +4 -5
  28. data/lib/cucumber/events/step_definition_registered.rb +4 -8
  29. data/lib/cucumber/events/test_case_finished.rb +0 -4
  30. data/lib/cucumber/events/test_case_started.rb +0 -4
  31. data/lib/cucumber/events/test_run_finished.rb +2 -3
  32. data/lib/cucumber/events/test_run_started.rb +2 -4
  33. data/lib/cucumber/events/test_step_finished.rb +0 -4
  34. data/lib/cucumber/events/test_step_started.rb +1 -5
  35. data/lib/cucumber/file_specs.rb +2 -1
  36. data/lib/cucumber/filters.rb +1 -0
  37. data/lib/cucumber/filters/activate_steps.rb +1 -1
  38. data/lib/cucumber/filters/apply_after_hooks.rb +1 -0
  39. data/lib/cucumber/filters/apply_after_step_hooks.rb +1 -0
  40. data/lib/cucumber/filters/apply_around_hooks.rb +1 -0
  41. data/lib/cucumber/filters/apply_before_hooks.rb +1 -0
  42. data/lib/cucumber/filters/broadcast_test_run_started_event.rb +2 -1
  43. data/lib/cucumber/filters/gated_receiver.rb +1 -2
  44. data/lib/cucumber/filters/prepare_world.rb +2 -5
  45. data/lib/cucumber/filters/quit.rb +2 -3
  46. data/lib/cucumber/filters/randomizer.rb +6 -7
  47. data/lib/cucumber/filters/retry.rb +2 -2
  48. data/lib/cucumber/filters/tag_limits.rb +2 -2
  49. data/lib/cucumber/filters/tag_limits/test_case_index.rb +1 -2
  50. data/lib/cucumber/filters/tag_limits/verifier.rb +1 -2
  51. data/lib/cucumber/formatter/ansicolor.rb +13 -12
  52. data/lib/cucumber/formatter/backtrace_filter.rb +1 -2
  53. data/lib/cucumber/formatter/console.rb +10 -11
  54. data/lib/cucumber/formatter/console_counts.rb +4 -4
  55. data/lib/cucumber/formatter/console_issues.rb +3 -3
  56. data/lib/cucumber/formatter/duration.rb +1 -0
  57. data/lib/cucumber/formatter/duration_extractor.rb +1 -1
  58. data/lib/cucumber/formatter/fail_fast.rb +9 -6
  59. data/lib/cucumber/formatter/fanout.rb +1 -3
  60. data/lib/cucumber/formatter/hook_query_visitor.rb +1 -0
  61. data/lib/cucumber/formatter/html.rb +27 -31
  62. data/lib/cucumber/formatter/html_builder.rb +2 -1
  63. data/lib/cucumber/formatter/ignore_missing_messages.rb +1 -2
  64. data/lib/cucumber/formatter/interceptor.rb +18 -5
  65. data/lib/cucumber/formatter/io.rb +1 -0
  66. data/lib/cucumber/formatter/json.rb +2 -1
  67. data/lib/cucumber/formatter/json_pretty.rb +1 -0
  68. data/lib/cucumber/formatter/junit.rb +16 -15
  69. data/lib/cucumber/formatter/pretty.rb +3 -2
  70. data/lib/cucumber/formatter/progress.rb +3 -2
  71. data/lib/cucumber/formatter/rerun.rb +1 -0
  72. data/lib/cucumber/formatter/stepdefs.rb +1 -0
  73. data/lib/cucumber/formatter/steps.rb +2 -2
  74. data/lib/cucumber/formatter/summary.rb +1 -1
  75. data/lib/cucumber/formatter/unicode.rb +2 -2
  76. data/lib/cucumber/formatter/usage.rb +21 -18
  77. data/lib/cucumber/gherkin/data_table_parser.rb +1 -0
  78. data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +86 -85
  79. data/lib/cucumber/gherkin/formatter/escaping.rb +13 -12
  80. data/lib/cucumber/gherkin/i18n.rb +1 -0
  81. data/lib/cucumber/gherkin/steps_parser.rb +1 -0
  82. data/lib/cucumber/glue/dsl.rb +1 -0
  83. data/lib/cucumber/glue/hook.rb +1 -0
  84. data/lib/cucumber/glue/invoke_in_world.rb +3 -3
  85. data/lib/cucumber/glue/proto_world.rb +8 -9
  86. data/lib/cucumber/glue/registry_and_more.rb +13 -12
  87. data/lib/cucumber/glue/snippet.rb +1 -5
  88. data/lib/cucumber/glue/step_definition.rb +9 -9
  89. data/lib/cucumber/glue/world_factory.rb +0 -2
  90. data/lib/cucumber/hooks.rb +1 -3
  91. data/lib/cucumber/load_path.rb +1 -0
  92. data/lib/cucumber/multiline_argument.rb +2 -2
  93. data/lib/cucumber/multiline_argument/data_table.rb +10 -10
  94. data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +4 -7
  95. data/lib/cucumber/multiline_argument/doc_string.rb +1 -0
  96. data/lib/cucumber/platform.rb +2 -1
  97. data/lib/cucumber/project_initializer.rb +1 -1
  98. data/lib/cucumber/rake/task.rb +7 -4
  99. data/lib/cucumber/rspec/disable_option_parser.rb +1 -0
  100. data/lib/cucumber/rspec/doubles.rb +1 -0
  101. data/lib/cucumber/running_test_case.rb +2 -1
  102. data/lib/cucumber/runtime.rb +5 -5
  103. data/lib/cucumber/runtime/after_hooks.rb +1 -0
  104. data/lib/cucumber/runtime/before_hooks.rb +1 -0
  105. data/lib/cucumber/runtime/for_programming_languages.rb +8 -7
  106. data/lib/cucumber/runtime/step_hooks.rb +2 -0
  107. data/lib/cucumber/runtime/support_code.rb +3 -7
  108. data/lib/cucumber/runtime/user_interface.rb +2 -3
  109. data/lib/cucumber/step_argument.rb +1 -0
  110. data/lib/cucumber/step_definition_light.rb +2 -1
  111. data/lib/cucumber/step_definitions.rb +1 -0
  112. data/lib/cucumber/step_match.rb +5 -7
  113. data/lib/cucumber/step_match_search.rb +1 -2
  114. data/lib/cucumber/term/ansicolor.rb +30 -30
  115. data/lib/cucumber/unit.rb +1 -0
  116. data/lib/cucumber/version +1 -1
  117. data/lib/simplecov_setup.rb +1 -0
  118. metadata +61 -117
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f84a6bf158202ae59a9b8db4a2659d3fbb54a8a5
4
- data.tar.gz: 5f2c8a03f201b4867664044e46b235c65c384e91
3
+ metadata.gz: 6fc886b206588160432745dd94cb419b71dd3952
4
+ data.tar.gz: ade0e5e45e889f9717baa2d2dd8fad60932bf667
5
5
  SHA512:
6
- metadata.gz: c24410fe9970358b71f76e01897bf3762e9a14b4d7424309d4f43fc113703e1f07e659acec28313b7958b2e97da05c4bc896ff9e0cc1cd94069f4c339831dab4
7
- data.tar.gz: 03ef3f7b197165f8fe83613be7a05d4aa3990f94968b067e3d15539242cc04e24c5136b21d7985298b7062449b8ade8ac4c0707b73d27b90cf33ab480bc9573e
6
+ metadata.gz: f9f244e9f05394029284305f8aa39a0472507c498ca764f9c3141bc96d9521e6d37ad6ec5e898b893dc726bcd57c9537acb40e479d42660f8f3bf946adea2b92
7
+ data.tar.gz: d68d77df58b2f659b5689334eb2a8833ba7bf2beb977a0da20dcb25a28e3c69e8b20bc76ecf25117e6a71914b98f4f094db85f8860f8b2caee8fbdcff3c24b7a
@@ -10,7 +10,7 @@ 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.0...master) (Not released)
13
+ ## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v3.1.1...master) (Not released)
14
14
 
15
15
  ### Added
16
16
 
@@ -32,7 +32,43 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
32
32
 
33
33
  * N/A
34
34
 
35
- ## [3.1.0](https://github.com/cucumber/cucumber-ruby/compare/v3.0.2...3.1.0) (2017-11-28)
35
+ ### Improved
36
+
37
+ * N/A
38
+
39
+ ## [3.1.1](https://github.com/cucumber/cucumber-ruby/compare/v3.1.0...v3.1.1) (2018-06-03)
40
+
41
+ ### Added
42
+
43
+ * N/A
44
+
45
+ ### Changed
46
+
47
+ * Add Rubocop to default Rake task ([#1256](https://github.com/cucumber/cucumber-ruby/pull/1256) [@jaysonesmith](https://github.com/jaysonesmith))
48
+ * Upgraded `cucumber-expressions` dependency to ~> 6.0.0 ([#1299](https://github.com/cucumber/cucumber-ruby/pull/1299) [@aslakhellesoy](https://github.com/aslakhellesoy))
49
+ * Upgraded to `gherkin` 5.1.0 ([#1299](https://github.com/cucumber/cucumber-ruby/pull/1299) [@aslakhellesoy](https://github.com/aslakhellesoy))
50
+
51
+ ### Deprecated
52
+
53
+ * N/A
54
+
55
+ ### Removed
56
+
57
+ * N/A
58
+
59
+ ### Fixed
60
+
61
+ * Make `--fail-fast` play nice with `--retry` ([#1283](https://github.com/cucumber/cucumber-ruby/pull/1283) [@yrral86](https://github.com/yrral86))
62
+ * Fix incompatible encodings error in JUnit formatter ([#1244](https://github.com/cucumber/cucumber-ruby/pull/1244) [@NickAb](https://github.com/NickAb)) (except on JRuby, see [#1259](https://github.com/cucumber/cucumber-ruby/pull/1259))
63
+ * Fix the handling of failed hooks in the JUnit Formatter ([@brasmusson](https://github.com/brasmusson))
64
+ * Fixed lengthy stacktrace when running `cucumber -f stepdefs` when steps aren't defined. ([#1286](https://github.com/cucumber/cucumber-ruby/pull/1286) [@xtrasimplicity](https://github.com/xtrasimplicity))
65
+ * Fixed an error with HTML snippet generation when `frozen_string_literal` is enabled and the `Syntax` gem is not installed. ([#1287](https://github.com/cucumber/cucumber-ruby/pull/1287) [@xtrasimplicity](https://github.com/xtrasimplicity))
66
+
67
+ ### Improved
68
+
69
+ * N/A
70
+
71
+ ## [3.1.0](https://github.com/cucumber/cucumber-ruby/compare/v3.0.2...v3.1.0) (2017-11-28)
36
72
 
37
73
  ### Added
38
74
 
@@ -79,6 +79,7 @@ Current release managers:
79
79
  * [Oleg Sukhodolsky](https://rubygems.org/profiles/os97673)
80
80
  * [Steve Tooke](https://rubygems.org/profiles/tooky)
81
81
  * [Björn Rasmusson](https://rubygems.org/profiles/brasmusson)
82
+ * [Andrew Walter](https://rubygems.org/profiles/xtrasimplicity)
82
83
 
83
84
  To grant release karma, issue the following commands:
84
85
 
data/README.md CHANGED
@@ -16,20 +16,19 @@ your team.
16
16
 
17
17
  Where to get more info:
18
18
 
19
- * The main website: https://cucumber.io/
20
- * Documentation: https://github.com/cucumber/cucumber/wiki
21
- * Ruby API Documentation: http://www.rubydoc.info/github/cucumber/cucumber-ruby/
22
- * Support forum: https://groups.google.com/group/cukes
23
- * Chat: ([Slack](https://cucumber.io/support#slack) and [Gitter](https://cucumber.io/support#gitter))
19
+ * The main website: https://cucumber.io/
20
+ * Documentation: https://docs.cucumber.io
21
+ * Ruby API Documentation: http://www.rubydoc.info/github/cucumber/cucumber-ruby/
22
+ * Support forum: https://groups.google.com/group/cukes
23
+ * Chat: ([Slack](https://cucumber.io/support#slack) and [Gitter](https://cucumber.io/support#gitter))
24
24
 
25
25
  See [CONTRIBUTING.md](CONTRIBUTING.md) for info on contributing to Cucumber.
26
26
 
27
27
  ## Supported platforms
28
-
28
+ * Ruby 2.5
29
29
  * Ruby 2.4
30
30
  * Ruby 2.3
31
31
  * Ruby 2.2
32
- * Ruby 2.1
33
32
  * JRuby 9.1
34
33
 
35
34
  ## Code of Conduct
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'autotest'
3
4
  require 'autotest/cucumber_mixin'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'autotest'
3
4
  require 'tempfile'
4
5
  require 'cucumber'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'autotest/rails'
3
4
  require 'autotest/cucumber_mixin'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'autotest/cucumber_mixin'
3
4
  require 'autotest/rails_rspec'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'autotest/cucumber_mixin'
3
4
  require 'autotest/rails_rspec2'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'autotest/cucumber_mixin'
3
4
  require 'autotest/rspec'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'autotest/cucumber_mixin'
3
4
  require 'autotest/rspec2'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Autotest.add_discovery do
3
4
  if File.directory?('features')
4
5
  if ENV['AUTOFEATURE'] =~ /true/i
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'yaml'
3
4
  require 'cucumber/encoding'
4
5
  require 'cucumber/platform'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'logger'
3
4
  require 'cucumber/cli/options'
4
5
  require 'cucumber/cli/rerun_file'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'optparse'
3
4
  require 'cucumber'
4
5
  require 'logger'
@@ -13,7 +14,7 @@ module Cucumber
13
14
  end
14
15
  end
15
16
 
16
- def initialize(args, _=nil, out=STDOUT, err=STDERR, kernel=Kernel)
17
+ def initialize(args, _ = nil, out = STDOUT, err = STDERR, kernel = Kernel)
17
18
  @args = args
18
19
  @out = out
19
20
  @err = err
@@ -70,7 +71,6 @@ module Cucumber
70
71
 
71
72
  private
72
73
 
73
-
74
74
  def exit_ok
75
75
  @kernel.exit 0
76
76
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'cucumber/cli/profile_loader'
3
4
  require 'cucumber/formatter/ansicolor'
4
5
  require 'cucumber/glue/registry_and_more'
@@ -7,9 +8,9 @@ require 'cucumber/core/test/result'
7
8
 
8
9
  module Cucumber
9
10
  module Cli
10
-
11
11
  class Options
12
12
  INDENT = ' ' * 53
13
+ # rubocop:disable Layout/MultilineOperationIndentation
13
14
  BUILTIN_FORMATS = {
14
15
  'html' => ['Cucumber::Formatter::Html', 'Generates a nice looking HTML report.'],
15
16
  'pretty' => ['Cucumber::Formatter::Pretty', 'Prints the feature as is - in colours.'],
@@ -27,19 +28,20 @@ module Cucumber
27
28
  'json_pretty' => ['Cucumber::Formatter::JsonPretty', 'Prints the feature as prettified JSON'],
28
29
  'summary' => ['Cucumber::Formatter::Summary', 'Summary output of feature and scenarios']
29
30
  }
31
+ # rubocop:enable Layout/MultilineOperationIndentation
30
32
  max = BUILTIN_FORMATS.keys.map(&:length).max
31
33
  FORMAT_HELP_MSG = [
32
- 'Use --format rerun --out rerun.txt to write out failing',
33
- 'features. You can rerun them with cucumber @rerun.txt.',
34
- 'FORMAT can also be the fully qualified class name of',
35
- "your own custom formatter. If the class isn't loaded,",
36
- 'Cucumber will attempt to require a file with a relative',
37
- 'file name that is the underscore name of the class name.',
38
- 'Example: --format Foo::BarZap -> Cucumber will look for',
39
- 'foo/bar_zap.rb. You can place the file with this relative',
40
- 'path underneath your features/support directory or anywhere',
41
- "on Ruby's LOAD_PATH, for example in a Ruby gem."
42
- ]
34
+ 'Use --format rerun --out rerun.txt to write out failing',
35
+ 'features. You can rerun them with cucumber @rerun.txt.',
36
+ 'FORMAT can also be the fully qualified class name of',
37
+ "your own custom formatter. If the class isn't loaded,",
38
+ 'Cucumber will attempt to require a file with a relative',
39
+ 'file name that is the underscore name of the class name.',
40
+ 'Example: --format Foo::BarZap -> Cucumber will look for',
41
+ 'foo/bar_zap.rb. You can place the file with this relative',
42
+ 'path underneath your features/support directory or anywhere',
43
+ "on Ruby's LOAD_PATH, for example in a Ruby gem."
44
+ ]
43
45
 
44
46
  FORMAT_HELP = (BUILTIN_FORMATS.keys.sort.map do |key|
45
47
  " #{key}#{' ' * (max - key.length)} : #{BUILTIN_FORMATS[key][1]}"
@@ -51,11 +53,11 @@ module Cucumber
51
53
  FAIL_FAST_FLAG = '--fail-fast'
52
54
  RETRY_FLAG = '--retry'
53
55
  OPTIONS_WITH_ARGS = [
54
- '-r', '--require', '--i18n-keywords', '-f', '--format', '-o',
55
- '--out', '-t', '--tags', '-n', '--name', '-e', '--exclude',
56
- PROFILE_SHORT_FLAG, PROFILE_LONG_FLAG, RETRY_FLAG, '-l',
57
- '--lines', '--port', '-I', '--snippet-type'
58
- ]
56
+ '-r', '--require', '--i18n-keywords', '-f', '--format', '-o',
57
+ '--out', '-t', '--tags', '-n', '--name', '-e', '--exclude',
58
+ PROFILE_SHORT_FLAG, PROFILE_LONG_FLAG, RETRY_FLAG, '-l',
59
+ '--lines', '--port', '-I', '--snippet-type'
60
+ ]
59
61
  ORDER_TYPES = %w{defined random}
60
62
  TAG_LIMIT_MATCHER = /(?<tag_name>\@\w+):(?<limit>\d+)/x
61
63
 
@@ -95,25 +97,25 @@ module Cucumber
95
97
  opts.banner = banner
96
98
  opts.on('-r LIBRARY|DIR', '--require LIBRARY|DIR', *require_files_msg) {|lib| require_files(lib) }
97
99
 
98
- if(Cucumber::JRUBY)
100
+ if Cucumber::JRUBY
99
101
  opts.on('-j DIR', '--jars DIR', 'Load all the jars under DIR') {|jars| load_jars(jars) }
100
102
  end
101
103
 
102
104
  opts.on("#{RETRY_FLAG} ATTEMPTS", *retry_msg) {|v| set_option :retry, v.to_i }
103
105
  opts.on('--i18n-languages', *i18n_languages_msg) { list_languages_and_exit }
104
- opts.on('--i18n-keywords LANG', *i18n_keywords_msg) {|lang| set_language lang }
106
+ opts.on('--i18n-keywords LANG', *i18n_keywords_msg) {|lang| language lang }
105
107
  opts.on(FAIL_FAST_FLAG, 'Exit immediately following the first failing scenario') { set_option :fail_fast }
106
108
  opts.on('-f FORMAT', '--format FORMAT', *format_msg, *FORMAT_HELP) do |v|
107
109
  add_option :formats, [*parse_formats(v), @out_stream]
108
110
  end
109
111
  opts.on('--init', *init_msg) {|v| initialize_project }
110
- opts.on('-o', '--out [FILE|DIR]', *out_msg) {|v| set_out_stream v }
112
+ opts.on('-o', '--out [FILE|DIR]', *out_msg) {|v| out_stream v }
111
113
  opts.on('-t TAG_EXPRESSION', '--tags TAG_EXPRESSION', *tags_msg) {|v| add_tag v }
112
114
  opts.on('-n NAME', '--name NAME', *name_msg) {|v| add_option :name_regexps, /#{v}/ }
113
115
  opts.on('-e', '--exclude PATTERN', *exclude_msg) {|v| add_option :excludes, Regexp.new(v) }
114
116
  opts.on(PROFILE_SHORT_FLAG, "#{PROFILE_LONG_FLAG} PROFILE", *profile_short_flag_msg) {|v| add_profile v }
115
117
  opts.on(NO_PROFILE_SHORT_FLAG, NO_PROFILE_LONG_FLAG, *no_profile_short_flag_msg) {|v| disable_profile_loading }
116
- opts.on('-c', '--[no-]color', *color_msg) {|v| set_color v }
118
+ opts.on('-c', '--[no-]color', *color_msg) {|v| color v }
117
119
  opts.on('-d', '--dry-run', *dry_run_msg) { set_dry_run_and_duration }
118
120
  opts.on('-m', '--no-multiline', "Don't print multiline strings and tables under steps.") { set_option :no_multiline }
119
121
  opts.on('-s', '--no-source', "Don't print the file and line of the step definition with the steps.") { set_option :source, false }
@@ -133,7 +135,7 @@ module Cucumber
133
135
  opts.on('-x', '--expand', 'Expand Scenario Outline Tables in output.') { set_option :expand }
134
136
 
135
137
  opts.on('--order TYPE[:SEED]', 'Run examples in the specified order. Available types:',
136
- *<<-TEXT.split("\n")) do |order|
138
+ *<<-TEXT.split("\n")) do |order|
137
139
  [defined] Run scenarios in the order they were defined (default).
138
140
  [random] Shuffle scenarios before running.
139
141
  Specify SEED to reproduce the shuffling from a previous run.
@@ -152,7 +154,7 @@ TEXT
152
154
  @args.map! { |a| "#{a}:#{@options[:lines]}" } if @options[:lines]
153
155
 
154
156
  extract_environment_variables
155
- @options[:paths] = @args.dup #whatver is left over
157
+ @options[:paths] = @args.dup # whatver is left over
156
158
 
157
159
  check_formatter_stream_conflicts()
158
160
 
@@ -201,11 +203,11 @@ TEXT
201
203
  end
202
204
 
203
205
  def exclude_msg
204
- [ "Don't run feature files or require ruby files matching PATTERN" ]
206
+ ["Don't run feature files or require ruby files matching PATTERN"]
205
207
  end
206
208
 
207
209
  def format_msg
208
- [ 'How to format features (Default: pretty). Available formats:' ]
210
+ ['How to format features (Default: pretty). Available formats:']
209
211
  end
210
212
 
211
213
  def i18n_languages_msg
@@ -229,7 +231,7 @@ TEXT
229
231
  end
230
232
 
231
233
  def lines_msg
232
- [ 'Run given line numbers. Equivalent to FILE:LINE syntax' ]
234
+ ['Run given line numbers. Equivalent to FILE:LINE syntax']
233
235
  end
234
236
 
235
237
  def no_profile_short_flag_msg
@@ -249,7 +251,7 @@ TEXT
249
251
  end
250
252
 
251
253
  def retry_msg
252
- [ 'Specify the number of times to retry failing tests (default: 0)' ]
254
+ ['Specify the number of times to retry failing tests (default: 0)']
253
255
  end
254
256
 
255
257
  def name_msg
@@ -273,7 +275,7 @@ TEXT
273
275
  [formatter, options_hash]
274
276
  end
275
277
 
276
- def set_out_stream(v)
278
+ def out_stream(v)
277
279
  @options[:formats] << ['pretty', {}, nil] if @options[:formats].empty?
278
280
  @options[:formats][-1][2] = v
279
281
  end
@@ -332,12 +334,12 @@ TEXT
332
334
 
333
335
  def banner
334
336
  [
335
- 'Usage: cucumber [options] [ [FILE|DIR|URL][:LINE[:LINE]*] ]+', '',
336
- 'Examples:',
337
- 'cucumber examples/i18n/en/features',
338
- 'cucumber @rerun.txt (See --format rerun)',
339
- 'cucumber examples/i18n/it/features/somma.feature:6:98:113',
340
- 'cucumber -s -i http://rubyurl.com/eeCl', '', ''
337
+ 'Usage: cucumber [options] [ [FILE|DIR|URL][:LINE[:LINE]*] ]+', '',
338
+ 'Examples:',
339
+ 'cucumber examples/i18n/en/features',
340
+ 'cucumber @rerun.txt (See --format rerun)',
341
+ 'cucumber examples/i18n/it/features/somma.feature:6:98:113',
342
+ 'cucumber -s -i http://rubyurl.com/eeCl', '', ''
341
343
  ].join("\n")
342
344
  end
343
345
 
@@ -352,7 +354,7 @@ TEXT
352
354
  Dir["#{jars}/**/*.jar"].each {|jar| require jar}
353
355
  end
354
356
 
355
- def set_language(lang)
357
+ def language(lang)
356
358
  require 'gherkin/dialect'
357
359
 
358
360
  return indicate_invalid_language_and_exit(lang) unless ::Gherkin::DIALECTS.keys.include? lang
@@ -391,7 +393,7 @@ TEXT
391
393
  tag_limits[tag_name] = limit
392
394
  end
393
395
 
394
- def set_color(color)
396
+ def color(color)
395
397
  Cucumber::Term::ANSIColor.coloring = color
396
398
  end
397
399
 
@@ -403,7 +405,7 @@ TEXT
403
405
  @profiles << p
404
406
  end
405
407
 
406
- def set_option(option, value=nil)
408
+ def set_option(option, value = nil)
407
409
  @options[option] = value.nil? ? true : value
408
410
  end
409
411
 
@@ -553,7 +555,8 @@ TEXT
553
555
  data = Cucumber::MultilineArgument::DataTable.from(
554
556
  ::Gherkin::DIALECTS.keys.map do |key|
555
557
  [key, ::Gherkin::DIALECTS[key].fetch('name'), ::Gherkin::DIALECTS[key].fetch('native')]
556
- end)
558
+ end
559
+ )
557
560
  @out_stream.write(data.to_s({ color: false, prefixes: Hash.new('') }))
558
561
  Kernel.exit(0)
559
562
  end
@@ -573,7 +576,7 @@ TEXT
573
576
  :dry_run => false,
574
577
  :formats => [],
575
578
  :excludes => [],
576
- :tag_expressions => [],
579
+ :tag_expressions => [],
577
580
  :tag_limits => {},
578
581
  :name_regexps => [],
579
582
  :env_vars => {},
@@ -585,6 +588,5 @@ TEXT
585
588
  }
586
589
  end
587
590
  end
588
-
589
591
  end
590
592
  end
@@ -1,11 +1,10 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'yaml'
3
4
 
4
5
  module Cucumber
5
6
  module Cli
6
-
7
7
  class ProfileLoader
8
-
9
8
  def initialize
10
9
  @cucumber_yml = nil
11
10
  end
@@ -60,7 +59,7 @@ Defined profiles in cucumber.yml:
60
59
  def cucumber_yml
61
60
  return @cucumber_yml if @cucumber_yml
62
61
  unless cucumber_yml_defined?
63
- raise(ProfilesNotDefinedError,"cucumber.yml was not found. Current directory is #{Dir.pwd}. Please refer to cucumber's documentation on defining profiles in cucumber.yml. You must define a 'default' profile to use the cucumber command without any arguments.\nType 'cucumber --help' for usage.\n")
62
+ raise(ProfilesNotDefinedError, "cucumber.yml was not found. Current directory is #{Dir.pwd}. Please refer to cucumber's documentation on defining profiles in cucumber.yml. You must define a 'default' profile to use the cucumber command without any arguments.\nType 'cucumber --help' for usage.\n")
64
63
  end
65
64
 
66
65
  require 'erb'
@@ -68,17 +67,17 @@ Defined profiles in cucumber.yml:
68
67
  begin
69
68
  @cucumber_erb = ERB.new(IO.read(cucumber_file), nil, '%').result(binding)
70
69
  rescue StandardError
71
- raise(YmlLoadError,"cucumber.yml was found, but could not be parsed with ERB. Please refer to cucumber's documentation on correct profile usage.\n#{$!.inspect}")
70
+ raise(YmlLoadError, "cucumber.yml was found, but could not be parsed with ERB. Please refer to cucumber's documentation on correct profile usage.\n#{$!.inspect}")
72
71
  end
73
72
 
74
73
  begin
75
74
  @cucumber_yml = YAML.load(@cucumber_erb)
76
75
  rescue StandardError
77
- raise(YmlLoadError,"cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.\n")
76
+ raise(YmlLoadError, "cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.\n")
78
77
  end
79
78
 
80
79
  if @cucumber_yml.nil? || !@cucumber_yml.is_a?(Hash)
81
- raise(YmlLoadError,"cucumber.yml was found, but was blank or malformed. Please refer to cucumber's documentation on correct profile usage.\n")
80
+ raise(YmlLoadError, "cucumber.yml was found, but was blank or malformed. Please refer to cucumber's documentation on correct profile usage.\n")
82
81
  end
83
82
 
84
83
  return @cucumber_yml
@@ -90,7 +89,6 @@ Defined profiles in cucumber.yml:
90
89
  def cucumber_file
91
90
  @cucumber_file ||= Dir.glob('{,.config/,config/}cucumber{.yml,.yaml}').first
92
91
  end
93
-
94
92
  end
95
93
  end
96
94
  end