cucumber 3.0.2 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +216 -17
  3. data/CONTRIBUTING.md +4 -21
  4. data/README.md +8 -10
  5. data/bin/cucumber +1 -1
  6. data/lib/autotest/cucumber.rb +1 -0
  7. data/lib/autotest/cucumber_mixin.rb +35 -39
  8. data/lib/autotest/cucumber_rails.rb +1 -0
  9. data/lib/autotest/cucumber_rails_rspec.rb +1 -0
  10. data/lib/autotest/cucumber_rails_rspec2.rb +1 -0
  11. data/lib/autotest/cucumber_rspec.rb +1 -0
  12. data/lib/autotest/cucumber_rspec2.rb +1 -0
  13. data/lib/autotest/discover.rb +1 -0
  14. data/lib/cucumber.rb +2 -1
  15. data/lib/cucumber/cli/configuration.rb +6 -5
  16. data/lib/cucumber/cli/main.rb +14 -14
  17. data/lib/cucumber/cli/options.rb +113 -116
  18. data/lib/cucumber/cli/profile_loader.rb +50 -29
  19. data/lib/cucumber/cli/rerun_file.rb +1 -0
  20. data/lib/cucumber/configuration.rb +38 -29
  21. data/lib/cucumber/constantize.rb +8 -10
  22. data/lib/cucumber/core_ext/string.rb +1 -0
  23. data/lib/cucumber/deprecate.rb +32 -8
  24. data/lib/cucumber/encoding.rb +2 -1
  25. data/lib/cucumber/errors.rb +6 -7
  26. data/lib/cucumber/events.rb +14 -7
  27. data/lib/cucumber/events/envelope.rb +9 -0
  28. data/lib/cucumber/events/gherkin_source_parsed.rb +11 -0
  29. data/lib/cucumber/events/gherkin_source_read.rb +1 -4
  30. data/lib/cucumber/events/hook_test_step_created.rb +13 -0
  31. data/lib/cucumber/events/step_activated.rb +6 -6
  32. data/lib/cucumber/events/step_definition_registered.rb +4 -8
  33. data/lib/cucumber/events/test_case_created.rb +13 -0
  34. data/lib/cucumber/events/test_case_finished.rb +0 -4
  35. data/lib/cucumber/events/test_case_ready.rb +12 -0
  36. data/lib/cucumber/events/test_case_started.rb +0 -4
  37. data/lib/cucumber/events/test_run_finished.rb +2 -3
  38. data/lib/cucumber/events/test_run_started.rb +2 -4
  39. data/lib/cucumber/events/test_step_created.rb +13 -0
  40. data/lib/cucumber/events/test_step_finished.rb +0 -4
  41. data/lib/cucumber/events/test_step_started.rb +1 -5
  42. data/lib/cucumber/events/undefined_parameter_type.rb +10 -0
  43. data/lib/cucumber/file_specs.rb +7 -6
  44. data/lib/cucumber/filters.rb +2 -0
  45. data/lib/cucumber/filters/activate_steps.rb +6 -4
  46. data/lib/cucumber/filters/apply_after_hooks.rb +1 -0
  47. data/lib/cucumber/filters/apply_after_step_hooks.rb +1 -0
  48. data/lib/cucumber/filters/apply_around_hooks.rb +1 -0
  49. data/lib/cucumber/filters/apply_before_hooks.rb +1 -0
  50. data/lib/cucumber/filters/broadcast_test_case_ready_event.rb +12 -0
  51. data/lib/cucumber/filters/broadcast_test_run_started_event.rb +2 -1
  52. data/lib/cucumber/filters/gated_receiver.rb +1 -2
  53. data/lib/cucumber/filters/prepare_world.rb +6 -13
  54. data/lib/cucumber/filters/quit.rb +3 -6
  55. data/lib/cucumber/filters/randomizer.rb +6 -7
  56. data/lib/cucumber/filters/retry.rb +2 -2
  57. data/lib/cucumber/filters/tag_limits.rb +2 -2
  58. data/lib/cucumber/filters/tag_limits/test_case_index.rb +1 -2
  59. data/lib/cucumber/filters/tag_limits/verifier.rb +3 -6
  60. data/lib/cucumber/formatter/ansicolor.rb +33 -37
  61. data/lib/cucumber/formatter/ast_lookup.rb +165 -0
  62. data/lib/cucumber/formatter/backtrace_filter.rb +10 -10
  63. data/lib/cucumber/formatter/console.rb +65 -74
  64. data/lib/cucumber/formatter/console_counts.rb +4 -9
  65. data/lib/cucumber/formatter/console_issues.rb +9 -6
  66. data/lib/cucumber/formatter/duration.rb +2 -1
  67. data/lib/cucumber/formatter/duration_extractor.rb +4 -2
  68. data/lib/cucumber/formatter/errors.rb +6 -0
  69. data/lib/cucumber/formatter/fail_fast.rb +9 -6
  70. data/lib/cucumber/formatter/fanout.rb +3 -3
  71. data/lib/cucumber/formatter/html.rb +11 -602
  72. data/lib/cucumber/formatter/http_io.rb +146 -0
  73. data/lib/cucumber/formatter/ignore_missing_messages.rb +2 -3
  74. data/lib/cucumber/formatter/interceptor.rb +11 -18
  75. data/lib/cucumber/formatter/io.rb +18 -11
  76. data/lib/cucumber/formatter/json.rb +102 -109
  77. data/lib/cucumber/formatter/junit.rb +73 -68
  78. data/lib/cucumber/formatter/message.rb +22 -0
  79. data/lib/cucumber/formatter/message_builder.rb +255 -0
  80. data/lib/cucumber/formatter/pretty.rb +360 -153
  81. data/lib/cucumber/formatter/progress.rb +31 -32
  82. data/lib/cucumber/formatter/query/hook_by_test_step.rb +31 -0
  83. data/lib/cucumber/formatter/query/pickle_by_test.rb +26 -0
  84. data/lib/cucumber/formatter/query/pickle_step_by_test_step.rb +26 -0
  85. data/lib/cucumber/formatter/query/step_definitions_by_test_step.rb +40 -0
  86. data/lib/cucumber/formatter/query/test_case_started_by_test_case.rb +40 -0
  87. data/lib/cucumber/formatter/rerun.rb +23 -4
  88. data/lib/cucumber/formatter/stepdefs.rb +2 -2
  89. data/lib/cucumber/formatter/steps.rb +4 -5
  90. data/lib/cucumber/formatter/summary.rb +17 -9
  91. data/lib/cucumber/formatter/unicode.rb +16 -18
  92. data/lib/cucumber/formatter/usage.rb +30 -26
  93. data/lib/cucumber/gherkin/data_table_parser.rb +18 -6
  94. data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +83 -86
  95. data/lib/cucumber/gherkin/formatter/escaping.rb +13 -12
  96. data/lib/cucumber/gherkin/i18n.rb +1 -0
  97. data/lib/cucumber/gherkin/steps_parser.rb +18 -8
  98. data/lib/cucumber/glue/dsl.rb +2 -1
  99. data/lib/cucumber/glue/hook.rb +35 -11
  100. data/lib/cucumber/glue/invoke_in_world.rb +15 -20
  101. data/lib/cucumber/glue/proto_world.rb +47 -39
  102. data/lib/cucumber/glue/registry_and_more.rb +54 -23
  103. data/lib/cucumber/glue/snippet.rb +24 -27
  104. data/lib/cucumber/glue/step_definition.rb +51 -28
  105. data/lib/cucumber/glue/world_factory.rb +1 -3
  106. data/lib/cucumber/hooks.rb +24 -14
  107. data/lib/cucumber/load_path.rb +1 -0
  108. data/lib/cucumber/multiline_argument.rb +6 -8
  109. data/lib/cucumber/multiline_argument/data_table.rb +106 -73
  110. data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +8 -11
  111. data/lib/cucumber/multiline_argument/doc_string.rb +2 -1
  112. data/lib/cucumber/platform.rb +4 -3
  113. data/lib/cucumber/project_initializer.rb +1 -1
  114. data/lib/cucumber/rake/task.rb +21 -18
  115. data/lib/cucumber/rspec/disable_option_parser.rb +10 -8
  116. data/lib/cucumber/rspec/doubles.rb +1 -0
  117. data/lib/cucumber/running_test_case.rb +4 -54
  118. data/lib/cucumber/runtime.rb +57 -61
  119. data/lib/cucumber/runtime/after_hooks.rb +9 -4
  120. data/lib/cucumber/runtime/before_hooks.rb +9 -4
  121. data/lib/cucumber/runtime/for_programming_languages.rb +12 -9
  122. data/lib/cucumber/runtime/step_hooks.rb +5 -2
  123. data/lib/cucumber/runtime/support_code.rb +16 -22
  124. data/lib/cucumber/runtime/user_interface.rb +8 -19
  125. data/lib/cucumber/step_definition_light.rb +6 -4
  126. data/lib/cucumber/step_definitions.rb +3 -2
  127. data/lib/cucumber/step_match.rb +20 -18
  128. data/lib/cucumber/step_match_search.rb +9 -9
  129. data/lib/cucumber/term/ansicolor.rb +39 -39
  130. data/lib/cucumber/unit.rb +1 -0
  131. data/lib/cucumber/version +1 -1
  132. data/lib/simplecov_setup.rb +1 -0
  133. metadata +214 -127
  134. data/lib/cucumber/formatter/cucumber.css +0 -286
  135. data/lib/cucumber/formatter/cucumber.sass +0 -247
  136. data/lib/cucumber/formatter/hook_query_visitor.rb +0 -41
  137. data/lib/cucumber/formatter/html_builder.rb +0 -120
  138. data/lib/cucumber/formatter/inline-js.js +0 -30
  139. data/lib/cucumber/formatter/jquery-min.js +0 -154
  140. data/lib/cucumber/formatter/json_pretty.rb +0 -10
  141. data/lib/cucumber/formatter/legacy_api/adapter.rb +0 -1028
  142. data/lib/cucumber/formatter/legacy_api/ast.rb +0 -394
  143. data/lib/cucumber/formatter/legacy_api/results.rb +0 -50
  144. data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +0 -32
  145. data/lib/cucumber/step_argument.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9ec5d9a669243f25746c71a44877f3db8c5ce993
4
- data.tar.gz: 514d163d359d7626cef2c2670992faf8cb6211b7
2
+ SHA256:
3
+ metadata.gz: fd820c5e08e32e33bba11e646e1e98d4382028b6e071914ddcb4982bb0657278
4
+ data.tar.gz: 13c93ab1fa304955ac45f8ce702eeb68dbcf2e316e383c9ae0ababe04a476762
5
5
  SHA512:
6
- metadata.gz: 9028e785c7f4f43bcd11aa4e4e44a976fa434901c2df26d4b5ec55e4b41bee69439646e0f179eeab1504de9b388d62fccf3fd71f49d44cddcc68f0052c3dfcb7
7
- data.tar.gz: cacc57c3d621b6682a2fb739fae0c69e7235ec46c71e36383b5e23938cca378a63a67799a3ae75427ff36f1320ed8fba4260c00299351443a25fb2a1f47b2836
6
+ metadata.gz: ddd5940fbb47aaa12942842323cf81372051ddf0ad496d9213dd93d0538afbe80e5e35edf6a5d27ccdea2840a1091f86b6f65ec46e14e017cbbe724fd61e1269
7
+ data.tar.gz: 27e575d0c0730bf88574d7e42262e031ff34328b71a22af15d0a3c1dc8d3b14dacc7d62250a912de01dda4d85bdd22615d166faaa78b81dc5e24bb75a71374fd
@@ -10,16 +10,206 @@ 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.0.2...master) (Not released)
13
+ ## [4.0.0](https://github.com/cucumber/cucumber-ruby/compare/v4.0.0.rc.5...v4.0.0)
14
+
15
+ ### Changed
16
+
17
+ * `log` method can now be called with non-string objects and will run `.to_s` on them. [#1410](https://github.com/cucumber/cucumber-ruby/issues/1410)
18
+
19
+ ### Improved
20
+
21
+ * Display snippet when using undefined parameter type [#1411](https://github.com/cucumber/cucumber-ruby/issues/1411)
22
+
23
+ ## [4.0.0.rc.6](https://github.com/cucumber/cucumber-ruby/compare/v4.0.0.rc.5...4.0.0.rc.6)
24
+
25
+ ### Changed
26
+
27
+ * Code snippet for an undefined step with a Doc String will ouput `doc_string` instead of `string` in block params
28
+ ([#1401](https://github.com/cucumber/cucumber-ruby/issues/1401)
29
+ [#1402](https://github.com/cucumber/cucumber-ruby/pull/1402)
30
+ [karamosky](https://github.com/karamosky))
31
+
32
+ * Updated monorepo libraries:
33
+ - cucumber-gherkin ~> 13
34
+ - cucumber-html-formatter ~> 6
35
+ - cucumber-cucumber-expressions ~> 10
36
+
37
+ * Use `cucumber-ruby-core` 7.0.0
38
+
39
+ * Use `cucumber-ruby-wire` 3.0.0
40
+
41
+ * Use `body` field of attachments
42
+
43
+ ### Improved
44
+
45
+ * `--out url` updates:
46
+ * supports redirects
47
+ * use `PUT` method by default
48
+ * use a cURL like options (for example: `cucumber --out 'http://example.com -X POST -H Content-Type: json`)
49
+
50
+ ## [4.0.0.rc.5](https://github.com/cucumber/cucumber-ruby/compare/v4.0.0.rc.4...4.0.0.rc.5)
14
51
 
15
52
  ### Added
16
53
 
17
- * N/A
54
+ * New html formatter enabled by option `--format html --out report.html`.
55
+
56
+ * Accept `--out URL` to POST results to a web server
57
+ If a URL is used as output, the output will be sent with a POST request.
58
+ This can be overridden by specifying e.g. `http-method=PUT` as a query parameter.
59
+ Other `http-` prefixed query parameters will be converted to request headers
60
+ (with the `http-` prefix stripped off).
61
+
62
+
63
+ ## [4.0.0.rc.4](https://github.com/cucumber/cucumber-ruby/compare/v4.0.0.rc.3...4.0.0.rc.4)
64
+
65
+ ### Added
66
+
67
+ * Add `message`formatter which produces `Cucumber::Messages` ndjson output.
68
+ * Comply with [`cucumber-compatibility-kit](https://github.com/cucumber/cucumber/tree/master/compatibility-kit)
69
+ * Methods `log` and `attach` can be used in step definitions to attach text or images
70
+
71
+ ### Deprecated
72
+
73
+ * `--format=json` in favor of the `message` formatter and the stand-alone JSON formatter
74
+ * `puts` in step definitions in favor of `log` ([cucumber#897](https://github.com/cucumber/cucumber/issues/897))
75
+ * `embed` in step definitions in favor of `attach` ([cucumber#897](https://github.com/cucumber/cucumber/issues/897))
76
+
77
+
78
+ ## [4.0.0.rc.3](https://github.com/cucumber/cucumber-ruby/compare/v4.0.0.rc.2...v4.0.0.rc.3)
79
+
80
+ ### Changed
81
+
82
+ * Update to cucumber-wire 1.1.
83
+
84
+
85
+ ## [4.0.0.rc.2](https://github.com/cucumber/cucumber-ruby/compare/v4.0.0.rc.1...v4.0.0.rc.2)
86
+
87
+ ### Added
88
+ * There is a new methodology in Cucumber for how the auto-loader works
89
+ * The old `load` behaviour is now replaced with a newer `require` behaviour
90
+ * Cucumber will (From version 4), now auto-load files using the `require` method
91
+ * If you wish to alter this, then you can set a top level config option: `Cucumber.use_legacy_autoloader`
92
+ * Like most config options, setting this inside a `spec_helper.rb` or `env.rb` file is advised
93
+ * For more information on this change, including why it was made. Please read this
94
+ [Blog Post](www.google.com)
95
+ ([#1349](https://github.com/cucumber/cucumber-ruby/pull/1349),
96
+ [#1043](https://github.com/cucumber/cucumber-ruby/issues/1043)
97
+ [luke-hill](https://github.com/luke-hill))
98
+
99
+ ### Changed
100
+ * Going forward the minimum ruby version for all cucumber based gems is 2.3
101
+ ([luke-hill](https://github.com/luke-hill))
102
+
103
+ ### Removed
104
+ * Removed Travis publish job for cucumber-pro(a.k.a. jam)
105
+ ([#1350](https://github.com/cucumber/cucumber-ruby/pull/1350)
106
+ [luke-hill](https://github.com/luke-hill))
107
+
108
+ * Drop support for JRuby. We may add this back if new versions of protobuf for JRuby
109
+ start working, or if someone can make the build pass with an older version.
110
+ All this means is we're ok to make releases while the jruby CI job is failing.
111
+
112
+ ([aslakhellesoy](https://github.com/aslakhellesoy))
113
+
114
+ * Remove `dots-formatter introduced in `4.0.0rc1`
115
+
116
+ ### Fixed
117
+
118
+ * Fix the placeholder expansions in the json formatter
119
+ ([#1361](https://github.com/cucumber/cucumber-ruby/pull/1361)
120
+ [brasmusson](https://github.com/brasmusson))
121
+ * Fix seed printed in cucumber UI to match the seed that was actually used.
122
+ ([#1329](https://github.com/cucumber/cucumber-ruby/pull/1329)
123
+ [deivid-rodriguez](https://github.com/deivid-rodriguez))
124
+ * Make SIGINT/`Ctrl+c` behavior consistent with SIGTERM/`kill` behavior - now first invocation causes existing scenario to stop running and jump to `at_exit`, second invocation causes immediate exit. Before that first invocation only instructed Cucumber to exit after scenario and second invocation caused immediate exit skipping `at_exit`.
125
+ ([#1353](https://github.com/cucumber/cucumber-ruby/pull/1353)
126
+ [akostadinov](https://github.com/akostadinov))
127
+
128
+ ### Improved
129
+
130
+ * Filter out any lines containing `site_ruby` from stacktrace
131
+
132
+ ## [4.0.0.rc.1](https://github.com/cucumber/cucumber-ruby/compare/v3.1.2...v4.0.0.rc.1) (2018-09-29)
133
+
134
+ ### Added
135
+
136
+ * Added support for new `Rule` keyword. [Read more here.](https://github.com/cucumber/cucumber/blob/master/gherkin/CHANGELOG.md#6013---2018-09-25)
137
+ * Added new `dots` formatter. This is the first step of a larger strategy to move the formatters to a new architecture where they delegate to shared executables via messages.
18
138
 
19
139
  ### Changed
20
140
 
141
+ * Use Gherkin v6.
142
+ ([#1313](https://github.com/cucumber/cucumber-ruby/pull/1313)
143
+ [brasmusson](https://github.com/brasmusson))
144
+ * Do not apply Before and After Hooks to Test Cases with no Test Steps.
145
+ ([#1311](https://github.com/cucumber/cucumber-ruby/pull/1311)
146
+ [brasmusson](https://github.com/brasmusson))
147
+ * Pass the registry to the Wire plugin.
148
+ ([#1309](https://github.com/cucumber/cucumber-ruby/pull/1309)
149
+ [brasmusson](https://github.com/brasmusson))
150
+ * Adapt to using the Gherkin compiler and Pickles in the core.
151
+ ([#1309](https://github.com/cucumber/cucumber-ruby/pull/1309)
152
+ [brasmusson](https://github.com/brasmusson))
153
+ * Let the Pretty Formatter use events.
154
+ ([#1305](https://github.com/cucumber/cucumber-ruby/pull/1305)
155
+ [brasmusson](https://github.com/brasmusson))
156
+ * Use single quotes in generated template steps ([#1323](https://github.com/cucumber/cucumber-ruby/pull/1323) [acant](https://github.com/acant))
157
+
158
+ ### Removed
159
+
160
+ * Remove the support of old style tag expressions.
161
+ ([#1314](https://github.com/cucumber/cucumber-ruby/pull/1314),
162
+ [brasmusson](https://github.com/brasmusson))
163
+ * Remove the Legacy API for Formatters.
164
+ ([#1230](https://github.com/cucumber/cucumber-ruby/pull/1230),
165
+ [#839](https://github.com/cucumber/cucumber-ruby/issues/839)
166
+ [brasmusson](https://github.com/brasmusson))
167
+ * Remove the JSON Pretty Formatter (which was the same as the JSON formatter).
168
+ ([brasmusson](https://github.com/brasmusson))
169
+ * Remove the HTML Formatter.
170
+ ([#1306](https://github.com/cucumber/cucumber-ruby/pull/1306)
171
+ [brasmusson](https://github.com/brasmusson))
172
+
173
+ ### Fixed
174
+
175
+ * Wire protocol compatibility for docstrings.
176
+ ([#1183](https://github.com/cucumber/cucumber-ruby/issues/1183))
177
+ * Let the Rerun Formatter handle flaky scenarios.
178
+ ([#1310](https://github.com/cucumber/cucumber-ruby/pull/1310)
179
+ [brasmusson](https://github.com/brasmusson))
180
+
181
+ ### Improved
182
+
183
+ * Code style changes completed as per backlog of Rubocop TODO file. ([#1021](https://github.com/cucumber/cucumber-ruby/issues/1021) [@jaysonesmith](https://github.com/jaysonesmith))
184
+
185
+ ## [3.1.2](https://github.com/cucumber/cucumber-ruby/compare/v3.1.1...v3.1.2) (2018-07-13)
186
+
187
+ ### Changed
188
+
189
+ * Upgraded to `cucumber-core` 3.2.0
190
+ * Change to use the gherkin step location in the Json formatter.
191
+ ([#1243](https://github.com/cucumber/cucumber-ruby/pull/1243),
192
+ [#1108](https://github.com/cucumber/cucumber-ruby/issues/1108)
193
+ [brasmusson](https://github.com/brasmusson))
194
+
195
+ ### Fixed
196
+
197
+ * Support ParameterType with empty capture group.
198
+ ([#404](https://github.com/cucumber/cucumber/issues/404)
199
+ [aslakhellesoy](https://github.com/aslakhellesoy))
200
+
201
+ ## [3.1.1](https://github.com/cucumber/cucumber-ruby/compare/v3.1.0...v3.1.1) (2018-06-03)
202
+
203
+ ### Added
204
+
21
205
  * N/A
22
206
 
207
+ ### Changed
208
+
209
+ * Add Rubocop to default Rake task ([#1256](https://github.com/cucumber/cucumber-ruby/pull/1256) [@jaysonesmith](https://github.com/jaysonesmith))
210
+ * Upgraded `cucumber-expressions` dependency to ~> 6.0.0 ([#1299](https://github.com/cucumber/cucumber-ruby/pull/1299) [@aslakhellesoy](https://github.com/aslakhellesoy))
211
+ * Upgraded to `gherkin` 5.1.0 ([#1299](https://github.com/cucumber/cucumber-ruby/pull/1299) [@aslakhellesoy](https://github.com/aslakhellesoy))
212
+
23
213
  ### Deprecated
24
214
 
25
215
  * N/A
@@ -30,12 +220,34 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
30
220
 
31
221
  ### Fixed
32
222
 
33
- * N/A
223
+ * Make `--fail-fast` play nice with `--retry` ([#1283](https://github.com/cucumber/cucumber-ruby/pull/1283) [@yrral86](https://github.com/yrral86))
224
+ * 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))
225
+ * Fix the handling of failed hooks in the JUnit Formatter ([@brasmusson](https://github.com/brasmusson))
226
+ * 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))
227
+ * 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))
34
228
 
35
229
  ### Improved
36
230
 
37
231
  * N/A
38
232
 
233
+ ## [3.1.0](https://github.com/cucumber/cucumber-ruby/compare/v3.0.2...v3.1.0) (2017-11-28)
234
+
235
+ ### Added
236
+
237
+ * ParameterType transformer runs in World
238
+ ([#1213](https://github.com/cucumber/cucumber-ruby/pull/1213)
239
+ [@aslakhellesoy](https://github.com/aslakhellesoy))
240
+
241
+ ### Changed
242
+
243
+ * Upgraded to `cucumber-expressions` 5.0.4
244
+ * Upgraded to `cucumber-tag_expressions` 1.1.0
245
+ * Upgraded to `gherkin` 5.0.0
246
+
247
+ ### Fixed
248
+
249
+ * Fix the handling of failed hooks in the JUnit Formatter ([@brasmusson](https://github.com/brasmusson))
250
+
39
251
  ## [3.0.2](https://github.com/cucumber/cucumber-ruby/compare/v3.0.1...v3.0.2) (2017-11-11)
40
252
 
41
253
  ### Removed
@@ -49,13 +261,6 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
49
261
  * Fix the printing of newlines in the rerun formatter - a problem introduced in [#1162](https://github.com/cucumber/cucumber-ruby/issues/1162) ([#1207](https://github.com/cucumber/cucumber-ruby/issues/1207) [@brasmusson](https://github.com/brasmusson))
50
262
  * Handle the `--retry` option in profiles ([#1050](https://github.com/cucumber/cucumber-ruby/issues/1050) [@brasmusson](https://github.com/brasmusson))
51
263
 
52
- ### Improved
53
-
54
- * Exclude the legacy_api from rubocop, regenerate Rubocop Todo ([@jaysonesmith](https://github.com/jaysonesmith), [@brasmusson](https://github.com/brasmusson))
55
- * Review and handle excluded/ignored cops ([#1208](https://github.com/cucumber/cucumber-ruby/pull/1208) [@jaysonesmith](https://github.com/jaysonesmith))
56
- * Fix SymbolProc issues ([#1212](https://github.com/cucumber/cucumber-ruby/pull/1212) [@jaysonesmith](https://github.com/jaysonesmith))
57
- * Fix TrailingBlankLines ([#1211](https://github.com/cucumber/cucumber-ruby/pull/1211) [@jaysonesmith](https://github.com/jaysonesmith))
58
-
59
264
  ## [3.0.1](https://github.com/cucumber/cucumber-ruby/compare/v3.0.0...3.0.1) (2017-09-29)
60
265
 
61
266
  ### Fixed
@@ -91,12 +296,6 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
91
296
  * Refactor: Extract HTMLBuilder#string_to_embed method to DRY up code ([#1187](https://github.com/cucumber/cucumber-ruby/pulls/1187) [@danascheider](https://github.com/danascheider))
92
297
  * As per [#251](https://github.com/cucumber/cucumber/issues/251): renamed History.md to CHANGELOG.md, added contributing message at beginning, and misc formatting. ([#1185](https://github.com/cucumber/cucumber-ruby/issues/1185) [jaysonesmith](https://github.com/jaysonesmith))
93
298
  * Use past tense in event names (`xStarting` -> `xStarted`) ([#1166](https://github.com/cucumber/cucumber-ruby/issues/1166) @brasmusson).
94
- * Fix Lint/DeprecatedClassMethods ([#1172](https://github.com/cucumber/cucumber-ruby/issues/1172) [jaysonesmith](https://github.com/jaysonesmith))
95
- * Fix Lint/DuplicateMethods ([#1173](https://github.com/cucumber/cucumber-ruby/issues/1173) [jaysonesmith](https://github.com/jaysonesmith))
96
- * Fix Metrics/LineLength ([#1175](https://github.com/cucumber/cucumber-ruby/issues/1175), [#1175](https://github.com/cucumber/cucumber-ruby/issues/1175), [#1176](https://github.com/cucumber/cucumber-ruby/issues/1176) [jaysonesmith](https://github.com/jaysonesmith))
97
- * Fix Style/AlignArray ([#1177](https://github.com/cucumber/cucumber-ruby/issues/1177) [jaysonesmith](https://github.com/jaysonesmith))
98
- * Fix Style/AndOr ([#1178](https://github.com/cucumber/cucumber-ruby/issues/1178) [jaysonesmith](https://github.com/jaysonesmith))
99
- * Fix Multiple Cops ([#1179](https://github.com/cucumber/cucumber-ruby/issues/1179) [jaysonesmith](https://github.com/jaysonesmith))
100
299
 
101
300
  ## [3.0.0.pre.2](https://github.com/cucumber/cucumber-ruby/compare/v2.4.0...v3.0.0.pre.2)
102
301
 
@@ -580,7 +779,7 @@ all.
580
779
  * Upgrade Gherkin version to remove warnings when running on JRuby. ([#393](https://github.com/cucumber/cucumber-ruby/issues/393) Oleg Sukhodolsky)
581
780
  * Do not use TagExpression.eval() which is deprecated in Gherkin 2.11.7 ([#420](https://github.com/cucumber/cucumber-ruby/issues/420) Oleg Sukhodolsky)
582
781
 
583
- ## 1.2.4
782
+ ## 1.2.4
584
783
 
585
784
  Yanked. See ([#428](https://github.com/cucumber/cucumber-ruby/issues/428)).
586
785
 
@@ -55,34 +55,17 @@ gem 'byebug'
55
55
  If you are new to the project or to OSS, check the label
56
56
  [Easy](https://github.com/cucumber/cucumber-ruby/labels/Easy). Also, you can
57
57
  help us to correct style violations reported here:
58
- [.rubocop_todo.yaml](https://github.com/cucumber/cucumber-ruby/blob/master/.rubocop_todo.yml).
58
+ [.rubocop_todo.yml](https://github.com/cucumber/cucumber-ruby/blob/master/.rubocop_todo.yml).
59
59
 
60
60
  ## Release Process
61
61
 
62
- * Bump the version number in `lib/cucumber/platform.rb`.
63
- * Make sure `History.md` is updated with the upcoming version number, and has entries for all fixes.
64
- * No need to add a `History.md` header at this point - this should be done when a new change is made, later.
65
- * Make sure you have up-to-date and clean copy of cucumber/cucumber.github.com.git at the same level as cucumber repo.
62
+ * Bump the version number in `lib/cucumber/version`.
63
+ * Make sure `CHANGELOG.md` is updated with the upcoming version number, and has entries for all fixes.
66
64
 
67
65
  Now release it
68
66
 
69
67
  bundle update
70
68
  bundle exec rake
71
69
  git commit -m "Release X.Y.Z"
70
+ # Make sure you run gem signin as the cukebot@cucumber.io user before running the following step. Credentials can be found in 1Password
72
71
  rake release
73
-
74
- ## Gaining Release Karma
75
-
76
- To become a release manager, create a pull request adding your name to the list below, and include your Rubygems email address in the ticket. One of the existing Release managers will then add you.
77
-
78
- Current release managers:
79
- * [Matt Wynne](https://rubygems.org/profiles/mattwynne)
80
- * [Aslak Hellesøy](https://rubygems.org/profiles/aslakhellesoy)
81
- * [Oleg Sukhodolsky](https://rubygems.org/profiles/os97673)
82
- * [Steve Tooke](https://rubygems.org/profiles/tooky)
83
- * [Björn Rasmusson](https://rubygems.org/profiles/brasmusson)
84
-
85
- To grant release karma, issue the following commands:
86
-
87
- gem owner cucumber --add <NEW OWNER RUBYGEMS EMAIL>
88
- gem owner cucumber-core --add <NEW OWNER RUBYGEMS EMAIL>
data/README.md CHANGED
@@ -5,7 +5,6 @@
5
5
 
6
6
  [![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby.svg)](https://codeclimate.com/github/cucumber/cucumber-ruby)
7
7
  [![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby/badge.svg?branch=master)](https://coveralls.io/r/cucumber/cucumber-ruby?branch=master)
8
- [![Dependency Status](https://gemnasium.com/cucumber/cucumber-ruby.svg)](https://gemnasium.com/cucumber/cucumber-ruby)
9
8
 
10
9
  # Cucumber
11
10
 
@@ -16,21 +15,20 @@ your team.
16
15
 
17
16
  Where to get more info:
18
17
 
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))
18
+ * The main website: https://cucumber.io/
19
+ * Documentation: https://cucumber.io/docs
20
+ * Ruby API Documentation: http://www.rubydoc.info/github/cucumber/cucumber-ruby/
21
+ * Support forum: https://groups.google.com/group/cukes
22
+ * Chat: ([Slack](https://cucumber.io/support#slack) and [Gitter](https://cucumber.io/support#gitter))
24
23
 
25
24
  See [CONTRIBUTING.md](CONTRIBUTING.md) for info on contributing to Cucumber.
26
25
 
27
26
  ## Supported platforms
28
-
27
+ * Ruby 2.6
28
+ * Ruby 2.5
29
29
  * Ruby 2.4
30
30
  * Ruby 2.3
31
- * Ruby 2.2
32
- * Ruby 2.1
33
- * JRuby 9.1
31
+ * JRuby 9.2 (with [some limitations](https://github.com/cucumber/cucumber-ruby/blob/master/docs/jruby-limitations.md))
34
32
 
35
33
  ## Code of Conduct
36
34
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  file_name = File.dirname(__FILE__) + '/../lib'
3
- $:.unshift(file_name) unless $:.include?(file_name)
3
+ $LOAD_PATH.unshift(file_name) unless $LOAD_PATH.include?(file_name)
4
4
 
5
5
  require 'simplecov_setup'
6
6
  require 'cucumber/rspec/disable_option_parser'
@@ -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'
@@ -6,7 +7,7 @@ require 'cucumber/cli/profile_loader'
6
7
 
7
8
  module Autotest::CucumberMixin
8
9
  def self.included(receiver)
9
- receiver::ALL_HOOKS << [:run_features, :ran_features]
10
+ receiver::ALL_HOOKS << %i[run_features ran_features]
10
11
  end
11
12
 
12
13
  attr_accessor :features_to_run
@@ -22,12 +23,10 @@ module Autotest::CucumberMixin
22
23
  reset_features
23
24
  add_sigint_handler
24
25
 
25
- self.last_mtime = Time.now if $f
26
-
27
26
  loop do # ^c handler
28
27
  begin
29
28
  get_to_green
30
- if self.tainted then
29
+ if tainted
31
30
  rerun_all_tests
32
31
  rerun_all_features if all_good
33
32
  else
@@ -38,7 +37,7 @@ module Autotest::CucumberMixin
38
37
  # time a file is changed to see if anything breaks.
39
38
  reset_features
40
39
  rescue Interrupt
41
- break if self.wants_to_quit
40
+ break if wants_to_quit
42
41
  reset
43
42
  reset_features
44
43
  end
@@ -50,12 +49,13 @@ module Autotest::CucumberMixin
50
49
  features_to_run == ''
51
50
  end
52
51
 
53
- def get_to_green
54
- begin
52
+ def get_to_green # rubocop:disable Naming/AccessorMethodName
53
+ loop do
55
54
  super
56
55
  run_features
57
56
  wait_for_changes unless all_features_good
58
- end until all_features_good
57
+ break if all_features_good
58
+ end
59
59
  end
60
60
 
61
61
  def rerun_all_features
@@ -70,67 +70,63 @@ module Autotest::CucumberMixin
70
70
  def run_features
71
71
  hook :run_features
72
72
  Tempfile.open('autotest-cucumber') do |dirty_features_file|
73
- cmd = self.make_cucumber_cmd(self.features_to_run, dirty_features_file.path)
73
+ cmd = make_cucumber_cmd(features_to_run, dirty_features_file.path)
74
74
  break if cmd.empty?
75
- puts cmd unless $q
76
75
  old_sync = $stdout.sync
77
76
  $stdout.sync = true
78
77
  self.results = []
79
78
  line = []
80
79
  begin
81
- open("| #{cmd}", 'r') do |f|
80
+ open("| #{cmd}", 'r') do |f| # rubocop:disable Security/Open
82
81
  until f.eof?
83
82
  c = f.getc || break
84
- if RUBY_VERSION >= '1.9' then
85
- print c
86
- else
87
- putc c
88
- end
83
+ print(c)
89
84
  line << c
90
- if c == ?\n then
91
- self.results << if RUBY_VERSION >= '1.9' then
92
- line.join
93
- else
94
- line.pack 'c*'
95
- end
96
- line.clear
97
- end
85
+ next unless c == "\n"
86
+ results << line.join
87
+ line.clear
98
88
  end
99
89
  end
100
90
  ensure
101
91
  $stdout.sync = old_sync
102
92
  end
103
93
  self.features_to_run = dirty_features_file.read.strip
104
- self.tainted = true unless self.features_to_run == ''
94
+ self.tainted = true unless features_to_run == ''
105
95
  end
106
96
  hook :ran_features
107
97
  end
108
98
 
109
- def make_cucumber_cmd(features_to_run, dirty_features_filename)
110
- return '' if features_to_run == ''
99
+ def make_cucumber_cmd(features_to_run, _dirty_features_filename)
100
+ return '' if features_to_run.empty?
111
101
 
112
102
  profile_loader = Cucumber::Cli::ProfileLoader.new
113
103
 
114
- profile ||= 'autotest-all' if profile_loader.has_profile?('autotest-all') && features_to_run == :all
115
- profile ||= 'autotest' if profile_loader.has_profile?('autotest')
116
- profile ||= nil
104
+ profile = profile(profile_loader)
105
+
106
+ args = created_args(features_to_run, profile)
107
+
108
+ "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY} #{args}"
109
+ end
110
+
111
+ def profile(profile_loader)
112
+ profile ||= 'autotest-all' if profile_loader.profile?('autotest-all') && features_to_run == :all
113
+ profile ||= 'autotest' if profile_loader.profile?('autotest')
114
+ profile || nil
115
+ end
117
116
 
117
+ def created_args(features_to_run, profile)
118
118
  args = if profile
119
119
  ['--profile', profile]
120
120
  else
121
- %w{--format} << (features_to_run == :all ? 'progress' : 'pretty')
121
+ %w[--format] << (features_to_run == :all ? 'progress' : 'pretty')
122
122
  end
123
123
  # No --color option as some IDEs (Netbeans) don't output them very well (1 failed step)
124
- args += %w{--format rerun --out} << dirty_features_filename
124
+ args += %w[--format rerun --out] << dirty_features_filename
125
125
  args << (features_to_run == :all ? '' : features_to_run)
126
126
 
127
- # Unless I do this, all the steps turn up undefined during the rerun...
128
- unless features_to_run == :all
129
- args << 'features/step_definitions' << 'features/support'
130
- end
131
-
132
- args = args.join(' ')
127
+ # All steps becom undefined during rerun unless the following is run.
128
+ args << 'features/step_definitions' << 'features/support' unless features_to_run == :all
133
129
 
134
- return "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY} #{args}"
130
+ args.join(' ')
135
131
  end
136
132
  end