cucumber 2.99.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. checksums.yaml +4 -4
  2. data/.cucumberproignore +6 -0
  3. data/.gitattributes +32 -0
  4. data/.github/ISSUE_TEMPLATE.md +1 -1
  5. data/.github/PULL_REQUEST_TEMPLATE.md +1 -0
  6. data/.rubocop.yml +13 -0
  7. data/.rubocop_todo.yml +991 -0
  8. data/.travis.yml +56 -10
  9. data/{History.md → CHANGELOG.md} +166 -32
  10. data/CONTRIBUTING.md +21 -1
  11. data/Gemfile +18 -5
  12. data/README.md +13 -4
  13. data/Rakefile +12 -2
  14. data/appveyor.yml +27 -0
  15. data/bin/cucumber +2 -1
  16. data/cucumber.gemspec +15 -10
  17. data/cucumber.yml +10 -11
  18. data/examples/i18n/Rakefile +1 -1
  19. data/examples/i18n/ar/features/step_definitions/calculator_steps.rb +8 -3
  20. data/examples/i18n/ar/lib/calculator.rb +2 -2
  21. data/examples/i18n/bg/features/step_definitions/calculator_steps.rb +6 -6
  22. data/examples/i18n/bg/features/support/env.rb +6 -1
  23. data/examples/i18n/bg/lib/calculator.rb +2 -1
  24. data/examples/i18n/ca/features/step_definitions/calculator_steps.rb +10 -5
  25. data/examples/i18n/ca/lib/calculadora.rb +2 -2
  26. data/examples/i18n/cs/features/step_definitions/calculator_steps.rb +10 -5
  27. data/examples/i18n/cs/lib/calculator.rb +3 -3
  28. data/examples/i18n/da/features/step_definitions/lommeregner_steps.rb +10 -5
  29. data/examples/i18n/da/lib/lommeregner.rb +2 -2
  30. data/examples/i18n/de/features/step_definitions/calculator_steps.rb +10 -5
  31. data/examples/i18n/de/lib/calculator.rb +2 -2
  32. data/examples/i18n/el/features/step_definitions/calculator_steps.rb +10 -5
  33. data/examples/i18n/el/lib/calculator.rb +2 -2
  34. data/examples/i18n/en/features/step_definitions/calculator_steps.rb +9 -4
  35. data/examples/i18n/en/lib/calculator.rb +2 -2
  36. data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +4 -4
  37. data/examples/i18n/en-lol/features/support/env.rb +6 -2
  38. data/examples/i18n/en-lol/lib/basket.rb +2 -2
  39. data/examples/i18n/en-lol/lib/belly.rb +2 -2
  40. data/examples/i18n/eo/features/step_definitions/calculator_steps.rb +9 -4
  41. data/examples/i18n/eo/lib/calculator.rb +2 -2
  42. data/examples/i18n/es/features/step_definitions/calculador_steps.rb +10 -5
  43. data/examples/i18n/es/lib/calculador.rb +2 -2
  44. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +10 -5
  45. data/examples/i18n/et/lib/kalkulaator.rb +3 -3
  46. data/examples/i18n/fi/features/step_definitions/laskin_steps.rb +9 -4
  47. data/examples/i18n/fi/lib/laskin.rb +1 -1
  48. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +8 -8
  49. data/examples/i18n/fr/features/support/env.rb +7 -2
  50. data/examples/i18n/fr/lib/calculatrice.rb +2 -2
  51. data/examples/i18n/he/features/step_definitions/calculator_steps.rb +10 -5
  52. data/examples/i18n/he/lib/calculator.rb +1 -1
  53. data/examples/i18n/hi/features/step_definitions/calculator_steps.rb +9 -4
  54. data/examples/i18n/hi/lib/calculator.rb +1 -1
  55. data/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb +9 -5
  56. data/examples/i18n/ht/lib/kalkilatris.rb +2 -2
  57. data/examples/i18n/hu/features/step_definitions/calculator_steps.rb +10 -5
  58. data/examples/i18n/hu/lib/calculator.rb +1 -1
  59. data/examples/i18n/id/features/step_definitions/calculator_steps.rb +10 -5
  60. data/examples/i18n/id/lib/calculator.rb +2 -2
  61. data/examples/i18n/it/features/step_definitions/calcolatrice_steps.rb +10 -5
  62. data/examples/i18n/it/lib/calcolatrice.rb +3 -3
  63. data/examples/i18n/ja/features/step_definitions/calculator_steps.rb +3 -3
  64. data/examples/i18n/ja/features/support/env.rb +7 -2
  65. data/examples/i18n/ja/lib/calculator.rb +2 -2
  66. data/examples/i18n/ko/features/step_definitions/calculator_steps.rb +10 -5
  67. data/examples/i18n/ko/lib/calculator.rb +2 -2
  68. data/examples/i18n/lt/features/step_definitions/calculator_steps.rb +10 -5
  69. data/examples/i18n/lt/lib/calculator.rb +2 -2
  70. data/examples/i18n/lv/features/step_definitions/calculator_steps.rb +10 -5
  71. data/examples/i18n/lv/lib/calculator.rb +2 -2
  72. data/examples/i18n/no/features/step_definitions/kalkulator_steps.rb +3 -3
  73. data/examples/i18n/no/features/support/env.rb +7 -2
  74. data/examples/i18n/no/lib/kalkulator.rb +2 -2
  75. data/examples/i18n/pl/features/step_definitions/calculator_steps.rb +10 -5
  76. data/examples/i18n/pl/features/support/env.rb +6 -1
  77. data/examples/i18n/pl/lib/calculator.rb +2 -2
  78. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +3 -3
  79. data/examples/i18n/pt/features/support/env.rb +7 -2
  80. data/examples/i18n/pt/lib/calculadora.rb +1 -1
  81. data/examples/i18n/ro/features/step_definitions/calculator_steps.rb +11 -6
  82. data/examples/i18n/ro/lib/calculator.rb +1 -1
  83. data/examples/i18n/ru/features/step_definitions/calculator_steps.rb +5 -5
  84. data/examples/i18n/ru/features/support/env.rb +6 -1
  85. data/examples/i18n/ru/lib/calculator.rb +2 -1
  86. data/examples/i18n/sk/features/step_definitions/calculator_steps.rb +10 -5
  87. data/examples/i18n/sk/lib/calculator.rb +2 -2
  88. data/examples/i18n/sr-Cyrl/features/step_definitions/calculator_steps.rb +3 -3
  89. data/examples/i18n/sr-Cyrl/features/support/env.rb +7 -2
  90. data/examples/i18n/sr-Cyrl/lib/calculator.rb +2 -2
  91. data/examples/i18n/sr-Latn/features/step_definitions/calculator_steps.rb +10 -5
  92. data/examples/i18n/sr-Latn/lib/calculator.rb +2 -2
  93. data/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb +9 -4
  94. data/examples/i18n/sv/lib/kalkulator.rb +2 -2
  95. data/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb +10 -5
  96. data/examples/i18n/tr/lib/hesap_makinesi.rb +2 -2
  97. data/examples/i18n/uk/features/step_definitions/calculator_steps.rb +4 -4
  98. data/examples/i18n/uk/features/support/env.rb +6 -1
  99. data/examples/i18n/uk/lib/calculator.rb +2 -1
  100. data/examples/i18n/uz/features/step_definitions/calculator_steps.rb +4 -4
  101. data/examples/i18n/uz/features/support/env.rb +6 -1
  102. data/examples/i18n/uz/lib/calculator.rb +2 -1
  103. data/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb +11 -6
  104. data/examples/i18n/zh-CN/lib/calculator.rb +2 -2
  105. data/examples/i18n/zh-TW/features/step_definitions/calculator_steps.rb +10 -5
  106. data/examples/i18n/zh-TW/lib/calculator.rb +2 -2
  107. data/examples/rspec_doubles/features/step_definitions/calvin_steps.rb +3 -3
  108. data/examples/sinatra/features/step_definitions/add_steps.rb +4 -4
  109. data/examples/sinatra/features/support/env.rb +6 -1
  110. data/examples/tcl/features/step_definitions/fib_steps.rb +2 -2
  111. data/examples/tcl/features/support/env.rb +2 -1
  112. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +4 -4
  113. data/examples/watir/features/step_definitions/search_steps.rb +6 -5
  114. data/examples/watir/features/support/env.rb +5 -1
  115. data/examples/watir/features/support/screenshots.rb +5 -5
  116. data/features/docs/api/list_step_defs_as_json.feature +21 -7
  117. data/features/docs/api/listen_for_events.feature +9 -8
  118. data/features/docs/api/run_cli_main_with_existing_runtime.feature +1 -0
  119. data/features/docs/cli/dry_run.feature +3 -0
  120. data/features/docs/cli/execute_with_tag_filter.feature +8 -6
  121. data/features/docs/cli/fail_fast.feature +2 -0
  122. data/features/docs/cli/help.feature +8 -0
  123. data/features/docs/{gherkin/language_help.feature → cli/i18n.feature} +6 -6
  124. data/features/docs/cli/randomize.feature +2 -2
  125. data/features/docs/cli/retry_failing_tests.feature +75 -15
  126. data/features/docs/cli/run_scenarios_matching_name.feature +1 -0
  127. data/features/docs/cli/specifying_multiple_formatters.feature +3 -0
  128. data/features/docs/cli/strict_mode.feature +6 -0
  129. data/features/docs/defining_steps/ambiguous_steps.feature +89 -0
  130. data/features/docs/defining_steps/nested_steps.feature +5 -1
  131. data/features/docs/defining_steps/nested_steps_i18n.feature +3 -0
  132. data/features/docs/defining_steps/nested_steps_with_second_arg.feature +2 -0
  133. data/features/docs/defining_steps/printing_messages.feature +1 -2
  134. data/features/docs/defining_steps/skip_scenario.feature +1 -34
  135. data/features/docs/defining_steps/snippets.feature +18 -18
  136. data/features/docs/events/gherkin_source_read_event.feature +43 -0
  137. data/features/docs/events/step_activated_event.feature +36 -0
  138. data/features/docs/events/step_definition_registered_event.feature +29 -0
  139. data/features/docs/events/test_case_finished_event.feature +35 -0
  140. data/features/docs/events/test_case_started_event.feature +54 -0
  141. data/features/docs/events/test_run_finished_event.feature +40 -0
  142. data/features/docs/events/test_run_started_event.feature +41 -0
  143. data/features/docs/events/test_step_finished_event.feature +47 -0
  144. data/features/docs/events/test_step_started_event.feature +43 -0
  145. data/features/docs/exception_in_after_hook.feature +3 -2
  146. data/features/docs/exception_in_after_step_hook.feature +2 -0
  147. data/features/docs/exception_in_around_hook.feature +2 -0
  148. data/features/docs/exception_in_before_hook.feature +3 -1
  149. data/features/docs/extending_cucumber/custom_formatter.feature +12 -48
  150. data/features/docs/formatters/json_formatter.feature +4 -4
  151. data/features/docs/formatters/junit_formatter.feature +7 -6
  152. data/features/docs/formatters/pretty_formatter.feature +1 -0
  153. data/features/docs/formatters/progress_formatter.feature +1 -0
  154. data/features/docs/formatters/rerun_formatter.feature +2 -0
  155. data/features/docs/formatters/summary_formatter.feature +35 -0
  156. data/features/docs/formatters/usage_formatter.feature +3 -0
  157. data/features/docs/getting_started.feature +2 -1
  158. data/features/docs/gherkin/background.feature +5 -5
  159. data/features/docs/gherkin/doc_strings.feature +2 -0
  160. data/features/docs/gherkin/expand_option_for_outlines.feature +1 -0
  161. data/features/docs/gherkin/outlines.feature +6 -4
  162. data/features/docs/gherkin/unicode_table.feature +2 -1
  163. data/features/docs/gherkin/using_descriptions.feature +1 -0
  164. data/features/docs/gherkin/using_star_notation.feature +1 -1
  165. data/features/docs/post_configuration_hook.feature +1 -17
  166. data/features/docs/rake_task.feature +5 -0
  167. data/features/docs/raketask.feature +3 -1
  168. data/features/docs/work_in_progress.feature +5 -2
  169. data/features/docs/writing_support_code/after_step_hooks.feature +3 -1
  170. data/features/docs/writing_support_code/around_hooks.feature +6 -0
  171. data/features/docs/writing_support_code/before_hook.feature +1 -0
  172. data/features/docs/writing_support_code/hook_order.feature +3 -1
  173. data/features/docs/writing_support_code/parameter_types.feature +53 -0
  174. data/features/docs/writing_support_code/tagged_hooks.feature +1 -1
  175. data/features/docs/writing_support_code/world.feature +129 -0
  176. data/features/lib/step_definitions/aruba_steps.rb +5 -10
  177. data/features/lib/step_definitions/cli_steps.rb +4 -0
  178. data/features/lib/step_definitions/cucumber_steps.rb +9 -12
  179. data/features/lib/step_definitions/iso-8859-1_steps.rb +9 -5
  180. data/features/lib/step_definitions/json_steps.rb +2 -1
  181. data/features/lib/step_definitions/junit_steps.rb +2 -1
  182. data/features/lib/step_definitions/language_steps.rb +3 -2
  183. data/features/lib/step_definitions/profile_steps.rb +7 -6
  184. data/features/lib/step_definitions/retry_steps.rb +33 -13
  185. data/features/lib/step_definitions/ruby_steps.rb +2 -1
  186. data/features/lib/support/env.rb +3 -2
  187. data/features/lib/support/fake_wire_server.rb +17 -3
  188. data/features/lib/support/feature_factory.rb +2 -1
  189. data/features/lib/support/normalise_output.rb +14 -12
  190. data/features/lib/support/parameter_types.rb +5 -0
  191. data/gem_tasks/contributors.rake +10 -6
  192. data/gem_tasks/cov.rake +1 -0
  193. data/gem_tasks/downloads.rb +1 -0
  194. data/gem_tasks/environment.rake +2 -5
  195. data/gem_tasks/examples.rake +3 -2
  196. data/gem_tasks/fix_cr_lf.rake +19 -7
  197. data/gem_tasks/flog.rake +4 -3
  198. data/gem_tasks/rspec.rake +2 -1
  199. data/gem_tasks/sass.rake +2 -1
  200. data/lib/autotest/cucumber.rb +1 -0
  201. data/lib/autotest/cucumber_mixin.rb +17 -16
  202. data/lib/autotest/cucumber_rails.rb +1 -0
  203. data/lib/autotest/cucumber_rails_rspec.rb +1 -0
  204. data/lib/autotest/cucumber_rails_rspec2.rb +1 -0
  205. data/lib/autotest/cucumber_rspec.rb +1 -0
  206. data/lib/autotest/cucumber_rspec2.rb +1 -0
  207. data/lib/autotest/discover.rb +3 -2
  208. data/lib/cucumber/cli/configuration.rb +12 -21
  209. data/lib/cucumber/cli/main.rb +8 -7
  210. data/lib/cucumber/cli/options.rb +341 -217
  211. data/lib/cucumber/cli/profile_loader.rb +26 -21
  212. data/lib/cucumber/cli/rerun_file.rb +1 -0
  213. data/lib/cucumber/configuration.rb +54 -37
  214. data/lib/cucumber/constantize.rb +2 -1
  215. data/lib/cucumber/core_ext/string.rb +2 -1
  216. data/lib/cucumber/deprecate.rb +4 -3
  217. data/lib/cucumber/encoding.rb +1 -0
  218. data/lib/cucumber/errors.rb +3 -1
  219. data/lib/cucumber/events/gherkin_source_read.rb +17 -0
  220. data/lib/cucumber/events/{step_match.rb → step_activated.rb} +5 -2
  221. data/lib/cucumber/events/step_definition_registered.rb +24 -0
  222. data/lib/cucumber/events/test_case_finished.rb +18 -0
  223. data/lib/cucumber/events/test_case_started.rb +15 -0
  224. data/lib/cucumber/events/test_run_finished.rb +12 -0
  225. data/lib/cucumber/events/test_run_started.rb +16 -0
  226. data/lib/cucumber/events/test_step_finished.rb +20 -0
  227. data/lib/cucumber/events/test_step_started.rb +17 -0
  228. data/lib/cucumber/events.rb +23 -3
  229. data/lib/cucumber/file_specs.rb +1 -0
  230. data/lib/cucumber/filters/activate_steps.rb +8 -3
  231. data/lib/cucumber/filters/apply_after_hooks.rb +1 -0
  232. data/lib/cucumber/filters/apply_after_step_hooks.rb +1 -0
  233. data/lib/cucumber/filters/apply_around_hooks.rb +1 -0
  234. data/lib/cucumber/filters/apply_before_hooks.rb +1 -0
  235. data/lib/cucumber/filters/broadcast_test_run_started_event.rb +27 -0
  236. data/lib/cucumber/filters/gated_receiver.rb +1 -0
  237. data/lib/cucumber/filters/prepare_world.rb +1 -0
  238. data/lib/cucumber/filters/quit.rb +1 -0
  239. data/lib/cucumber/filters/randomizer.rb +1 -0
  240. data/lib/cucumber/filters/retry.rb +4 -4
  241. data/lib/cucumber/filters/tag_limits/test_case_index.rb +1 -0
  242. data/lib/cucumber/filters/tag_limits/verifier.rb +2 -1
  243. data/lib/cucumber/filters/tag_limits.rb +4 -3
  244. data/lib/cucumber/filters.rb +3 -0
  245. data/lib/cucumber/formatter/ansicolor.rb +9 -11
  246. data/lib/cucumber/formatter/backtrace_filter.rb +21 -8
  247. data/lib/cucumber/formatter/console.rb +72 -66
  248. data/lib/cucumber/formatter/console_counts.rb +44 -0
  249. data/lib/cucumber/formatter/console_issues.rb +58 -0
  250. data/lib/cucumber/formatter/duration.rb +2 -1
  251. data/lib/cucumber/formatter/duration_extractor.rb +1 -0
  252. data/lib/cucumber/formatter/fail_fast.rb +4 -2
  253. data/lib/cucumber/formatter/fanout.rb +1 -0
  254. data/lib/cucumber/formatter/hook_query_visitor.rb +1 -0
  255. data/lib/cucumber/formatter/html.rb +175 -249
  256. data/lib/cucumber/formatter/html_builder.rb +120 -0
  257. data/lib/cucumber/formatter/ignore_missing_messages.rb +1 -0
  258. data/lib/cucumber/formatter/inline-js.js +30 -0
  259. data/lib/cucumber/formatter/interceptor.rb +3 -2
  260. data/lib/cucumber/formatter/io.rb +2 -1
  261. data/lib/cucumber/formatter/json.rb +33 -30
  262. data/lib/cucumber/formatter/json_pretty.rb +1 -0
  263. data/lib/cucumber/formatter/junit.rb +26 -24
  264. data/lib/cucumber/formatter/legacy_api/adapter.rb +81 -69
  265. data/lib/cucumber/formatter/legacy_api/ast.rb +27 -22
  266. data/lib/cucumber/formatter/legacy_api/results.rb +7 -8
  267. data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +1 -0
  268. data/lib/cucumber/formatter/pretty.rb +24 -18
  269. data/lib/cucumber/formatter/progress.rb +55 -13
  270. data/lib/cucumber/formatter/rerun.rb +15 -18
  271. data/lib/cucumber/formatter/stepdefs.rb +1 -0
  272. data/lib/cucumber/formatter/steps.rb +2 -1
  273. data/lib/cucumber/formatter/summary.rb +43 -20
  274. data/lib/cucumber/formatter/unicode.rb +2 -1
  275. data/lib/cucumber/formatter/usage.rb +33 -28
  276. data/lib/cucumber/gherkin/data_table_parser.rb +1 -0
  277. data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +2 -1
  278. data/lib/cucumber/gherkin/formatter/escaping.rb +2 -1
  279. data/lib/cucumber/gherkin/i18n.rb +1 -0
  280. data/lib/cucumber/gherkin/steps_parser.rb +1 -0
  281. data/lib/cucumber/{rb_support/rb_dsl.rb → glue/dsl.rb} +41 -30
  282. data/lib/cucumber/glue/hook.rb +43 -0
  283. data/lib/cucumber/glue/invoke_in_world.rb +70 -0
  284. data/lib/cucumber/glue/proto_world.rb +220 -0
  285. data/lib/cucumber/{rb_support/rb_language.rb → glue/registry_and_more.rb} +60 -90
  286. data/lib/cucumber/{rb_support → glue}/snippet.rb +64 -26
  287. data/lib/cucumber/glue/step_definition.rb +143 -0
  288. data/lib/cucumber/glue/world_factory.rb +23 -0
  289. data/lib/cucumber/hooks.rb +9 -8
  290. data/lib/cucumber/load_path.rb +1 -0
  291. data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +158 -0
  292. data/lib/cucumber/multiline_argument/data_table.rb +47 -181
  293. data/lib/cucumber/multiline_argument/doc_string.rb +1 -0
  294. data/lib/cucumber/multiline_argument.rb +6 -15
  295. data/lib/cucumber/platform.rb +4 -5
  296. data/lib/cucumber/project_initializer.rb +3 -2
  297. data/lib/cucumber/rake/task.rb +19 -14
  298. data/lib/cucumber/rspec/disable_option_parser.rb +2 -1
  299. data/lib/cucumber/rspec/doubles.rb +2 -1
  300. data/lib/cucumber/running_test_case.rb +3 -27
  301. data/lib/cucumber/runtime/after_hooks.rb +2 -1
  302. data/lib/cucumber/runtime/before_hooks.rb +1 -0
  303. data/lib/cucumber/runtime/for_programming_languages.rb +2 -36
  304. data/lib/cucumber/runtime/step_hooks.rb +1 -0
  305. data/lib/cucumber/runtime/support_code.rb +21 -16
  306. data/lib/cucumber/runtime/user_interface.rb +10 -16
  307. data/lib/cucumber/runtime.rb +49 -32
  308. data/lib/cucumber/step_argument.rb +1 -2
  309. data/lib/cucumber/step_definition_light.rb +2 -0
  310. data/lib/cucumber/step_definitions.rb +1 -0
  311. data/lib/cucumber/step_match.rb +30 -15
  312. data/lib/cucumber/step_match_search.rb +3 -3
  313. data/lib/cucumber/term/ansicolor.rb +2 -1
  314. data/lib/cucumber/unit.rb +1 -0
  315. data/lib/cucumber/version +1 -1
  316. data/lib/cucumber.rb +1 -13
  317. data/lib/simplecov_setup.rb +2 -1
  318. data/scripts/invite-collaborator +40 -0
  319. data/scripts/update-changelog +86 -0
  320. data/spec/cucumber/cli/configuration_spec.rb +109 -98
  321. data/spec/cucumber/cli/main_spec.rb +8 -7
  322. data/spec/cucumber/cli/options_spec.rb +114 -79
  323. data/spec/cucumber/cli/profile_loader_spec.rb +25 -5
  324. data/spec/cucumber/cli/rerun_spec.rb +21 -20
  325. data/spec/cucumber/configuration_spec.rb +48 -47
  326. data/spec/cucumber/constantize_spec.rb +3 -2
  327. data/spec/cucumber/events_spec.rb +9 -0
  328. data/spec/cucumber/file_specs_spec.rb +26 -25
  329. data/spec/cucumber/filters/activate_steps_spec.rb +25 -22
  330. data/spec/cucumber/filters/gated_receiver_spec.rb +7 -6
  331. data/spec/cucumber/filters/retry_spec.rb +42 -23
  332. data/spec/cucumber/filters/tag_limits/test_case_index_spec.rb +12 -11
  333. data/spec/cucumber/filters/tag_limits/verifier_spec.rb +15 -14
  334. data/spec/cucumber/filters/tag_limits_spec.rb +9 -8
  335. data/spec/cucumber/formatter/ansicolor_spec.rb +10 -9
  336. data/spec/cucumber/formatter/backtrace_filter_spec.rb +32 -0
  337. data/spec/cucumber/formatter/console_counts_spec.rb +14 -0
  338. data/spec/cucumber/formatter/duration_spec.rb +4 -3
  339. data/spec/cucumber/formatter/fail_fast_spec.rb +27 -27
  340. data/spec/cucumber/formatter/html_spec.rb +65 -60
  341. data/spec/cucumber/formatter/interceptor_spec.rb +1 -0
  342. data/spec/cucumber/formatter/json_spec.rb +71 -97
  343. data/spec/cucumber/formatter/junit_spec.rb +46 -47
  344. data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +134 -141
  345. data/spec/cucumber/formatter/pretty_spec.rb +105 -117
  346. data/spec/cucumber/formatter/progress_spec.rb +22 -21
  347. data/spec/cucumber/formatter/rerun_spec.rb +70 -64
  348. data/spec/cucumber/formatter/spec_helper.rb +14 -12
  349. data/spec/cucumber/{rb_support/rb_world_spec.rb → glue/proto_world_spec.rb} +22 -6
  350. data/spec/cucumber/glue/registry_and_more_spec.rb +213 -0
  351. data/spec/cucumber/{rb_support → glue}/snippet_spec.rb +62 -25
  352. data/spec/cucumber/glue/step_definition_spec.rb +207 -0
  353. data/spec/cucumber/hooks_spec.rb +5 -4
  354. data/spec/cucumber/multiline_argument/data_table_spec.rb +179 -129
  355. data/spec/cucumber/project_initializer_spec.rb +12 -11
  356. data/spec/cucumber/rake/forked_spec.rb +22 -17
  357. data/spec/cucumber/rake/task_spec.rb +21 -20
  358. data/spec/cucumber/running_test_case_spec.rb +36 -35
  359. data/spec/cucumber/runtime/for_programming_languages_spec.rb +2 -30
  360. data/spec/cucumber/runtime/support_code_spec.rb +1 -0
  361. data/spec/cucumber/runtime_spec.rb +3 -2
  362. data/spec/cucumber/step_argument_spec.rb +6 -5
  363. data/spec/cucumber/step_match_search_spec.rb +32 -41
  364. data/spec/cucumber/step_match_spec.rb +34 -33
  365. data/spec/cucumber/world/pending_spec.rb +12 -11
  366. data/spec/spec_helper.rb +1 -0
  367. data/spec/support/standard_step_actions.rb +2 -1
  368. metadata +132 -61
  369. data/features/docs/formatters/debug_formatter.feature +0 -47
  370. data/features/docs/formatters/formatter_step_file_colon_line.feature +0 -44
  371. data/features/docs/writing_support_code/transforms.feature +0 -98
  372. data/features/lib/step_definitions/wire_steps.rb +0 -58
  373. data/gem_tasks/cucumber.rake +0 -25
  374. data/lib/cucumber/ast.rb +0 -13
  375. data/lib/cucumber/core_ext/instance_exec.rb +0 -70
  376. data/lib/cucumber/events/after_test_case.rb +0 -25
  377. data/lib/cucumber/events/after_test_step.rb +0 -30
  378. data/lib/cucumber/events/before_test_case.rb +0 -18
  379. data/lib/cucumber/events/before_test_step.rb +0 -23
  380. data/lib/cucumber/events/bus.rb +0 -86
  381. data/lib/cucumber/events/finished_testing.rb +0 -9
  382. data/lib/cucumber/formatter/debug.rb +0 -35
  383. data/lib/cucumber/formatter/event_bus_report.rb +0 -38
  384. data/lib/cucumber/rb_support/rb_hook.rb +0 -19
  385. data/lib/cucumber/rb_support/rb_step_definition.rb +0 -131
  386. data/lib/cucumber/rb_support/rb_transform.rb +0 -59
  387. data/lib/cucumber/rb_support/rb_world.rb +0 -149
  388. data/spec/cucumber/core_ext/instance_exec_spec.rb +0 -4
  389. data/spec/cucumber/events/bus_spec.rb +0 -94
  390. data/spec/cucumber/formatter/debug_spec.rb +0 -64
  391. data/spec/cucumber/formatter/event_bus_report_spec.rb +0 -88
  392. data/spec/cucumber/rb_support/rb_language_spec.rb +0 -243
  393. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +0 -199
  394. data/spec/cucumber/rb_support/rb_transform_spec.rb +0 -46
  395. data/spec/cucumber_spec.rb +0 -39
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
  require 'cucumber/formatter/spec_helper'
3
4
  require 'cucumber/formatter/pretty'
@@ -9,32 +10,19 @@ module Cucumber
9
10
  extend SpecHelperDsl
10
11
  include SpecHelper
11
12
 
12
- context "With no options" do
13
+ context 'With no options' do
13
14
  before(:each) do
14
15
  Cucumber::Term::ANSIColor.coloring = false
15
16
  @out = StringIO.new
16
17
  @formatter = Pretty.new(runtime, @out, {})
17
18
  end
18
19
 
19
- describe "given a single feature" do
20
+ describe 'given a single feature' do
20
21
  before(:each) do
21
22
  run_defined_feature
22
23
  end
23
24
 
24
- describe "with a scenario with no steps" do
25
- define_feature <<-FEATURE
26
- Feature: Banana party
27
-
28
- Scenario: Monkey eats banana
29
- FEATURE
30
-
31
- it "outputs the scenario name" do
32
- expect(@out.string).to include "Scenario: Monkey eats banana"
33
- end
34
- end
35
-
36
-
37
- describe "with a scenario" do
25
+ describe 'with a scenario' do
38
26
  define_feature <<-FEATURE
39
27
  Feature: Banana party
40
28
 
@@ -42,16 +30,16 @@ module Cucumber
42
30
  Given there are bananas
43
31
  FEATURE
44
32
 
45
- it "outputs the scenario name" do
46
- expect(@out.string).to include "Scenario: Monkey eats banana"
33
+ it 'outputs the scenario name' do
34
+ expect(@out.string).to include 'Scenario: Monkey eats banana'
47
35
  end
48
36
 
49
- it "outputs the step" do
50
- expect(@out.string).to include "Given there are bananas"
37
+ it 'outputs the step' do
38
+ expect(@out.string).to include 'Given there are bananas'
51
39
  end
52
40
  end
53
41
 
54
- describe "with a background" do
42
+ describe 'with a background' do
55
43
  define_feature <<-FEATURE
56
44
  Feature: Banana party
57
45
 
@@ -62,20 +50,20 @@ Feature: Banana party
62
50
  Given there are bananas
63
51
  FEATURE
64
52
 
65
- it "outputs the gherkin" do
53
+ it 'outputs the gherkin' do
66
54
  expect(@out.string).to include(self.class.feature_content)
67
55
  end
68
56
 
69
- it "outputs the scenario name" do
70
- expect(@out.string).to include "Scenario: Monkey eats banana"
57
+ it 'outputs the scenario name' do
58
+ expect(@out.string).to include 'Scenario: Monkey eats banana'
71
59
  end
72
60
 
73
- it "outputs the step" do
74
- expect(@out.string).to include "Given there are bananas"
61
+ it 'outputs the step' do
62
+ expect(@out.string).to include 'Given there are bananas'
75
63
  end
76
64
  end
77
65
 
78
- describe "with a scenario outline" do
66
+ describe 'with a scenario outline' do
79
67
  define_feature <<-FEATURE
80
68
  Feature: Fud Pyramid
81
69
 
@@ -92,7 +80,7 @@ Feature: Banana party
92
80
  | carrots |
93
81
  FEATURE
94
82
 
95
- it "outputs the scenario outline" do
83
+ it 'outputs the scenario outline' do
96
84
  lines = <<-OUTPUT
97
85
  Examples: Fruit
98
86
  | Things |
@@ -108,12 +96,12 @@ Feature: Banana party
108
96
  end
109
97
  end
110
98
 
111
- it "has 4 undefined scenarios" do
112
- expect(@out.string).to include "4 scenarios (4 undefined)"
99
+ it 'has 4 undefined scenarios' do
100
+ expect(@out.string).to include '4 scenarios (4 undefined)'
113
101
  end
114
102
 
115
- it "has 4 undefined steps" do
116
- expect(@out.string).to include "4 steps (4 undefined)"
103
+ it 'has 4 undefined steps' do
104
+ expect(@out.string).to include '4 steps (4 undefined)'
117
105
  end
118
106
 
119
107
  context 'when the examples table header is wider than the rows' do
@@ -128,7 +116,7 @@ Feature: Banana party
128
116
  | Hominidae |
129
117
  FEATURE
130
118
 
131
- it "outputs the scenario outline" do
119
+ it 'outputs the scenario outline' do
132
120
  lines = <<-OUTPUT
133
121
  Examples:
134
122
  | Types of monkey |
@@ -142,7 +130,7 @@ Feature: Banana party
142
130
  end
143
131
 
144
132
  # To ensure https://rspec.lighthouseapp.com/projects/16211/tickets/475 remains fixed.
145
- describe "with a scenario outline with a pystring" do
133
+ describe 'with a scenario outline with a pystring' do
146
134
  define_feature <<-FEATURE
147
135
  Feature:
148
136
  Scenario Outline: Monkey eats a balanced diet
@@ -156,7 +144,7 @@ Feature: Banana party
156
144
  | apples |
157
145
  FEATURE
158
146
 
159
- it "outputs the scenario outline" do
147
+ it 'outputs the scenario outline' do
160
148
  lines = <<-OUTPUT
161
149
  Given a multiline string:
162
150
  """
@@ -173,7 +161,7 @@ Feature: Banana party
173
161
  end
174
162
  end
175
163
 
176
- describe "with a step with a py string" do
164
+ describe 'with a step with a py string' do
177
165
  define_feature <<-FEATURE
178
166
  Feature: Traveling circus
179
167
 
@@ -184,7 +172,7 @@ Feature: Banana party
184
172
  """
185
173
  FEATURE
186
174
 
187
- it "displays the pystring nested" do
175
+ it 'displays the pystring nested' do
188
176
  expect(@out.string).to include <<OUTPUT
189
177
  """
190
178
  foo
@@ -193,7 +181,7 @@ OUTPUT
193
181
  end
194
182
  end
195
183
 
196
- describe "with a multiline step arg" do
184
+ describe 'with a multiline step arg' do
197
185
  define_feature <<-FEATURE
198
186
  Feature: Traveling circus
199
187
 
@@ -204,7 +192,7 @@ OUTPUT
204
192
  | bar |
205
193
  FEATURE
206
194
 
207
- it "displays the multiline string" do
195
+ it 'displays the multiline string' do
208
196
  expect(@out.string).to include <<OUTPUT
209
197
  Given there are monkeys:
210
198
  | name |
@@ -214,7 +202,7 @@ OUTPUT
214
202
  end
215
203
  end
216
204
 
217
- describe "with a table in the background and the scenario" do
205
+ describe 'with a table in the background and the scenario' do
218
206
  define_feature <<-FEATURE
219
207
  Feature: accountant monkey
220
208
 
@@ -228,7 +216,7 @@ OUTPUT
228
216
  | g | h |
229
217
  FEATURE
230
218
 
231
- it "displays the table for the background" do
219
+ it 'displays the table for the background' do
232
220
  expect(@out.string).to include <<OUTPUT
233
221
  Given table:
234
222
  | a | b |
@@ -236,7 +224,7 @@ OUTPUT
236
224
  OUTPUT
237
225
  end
238
226
 
239
- it "displays the table for the scenario" do
227
+ it 'displays the table for the scenario' do
240
228
  expect(@out.string).to include <<OUTPUT
241
229
  Given another table:
242
230
  | e | f |
@@ -245,7 +233,7 @@ OUTPUT
245
233
  end
246
234
  end
247
235
 
248
- describe "with a py string in the background and the scenario" do
236
+ describe 'with a py string in the background and the scenario' do
249
237
  define_feature <<-FEATURE
250
238
  Feature: py strings
251
239
 
@@ -261,7 +249,7 @@ OUTPUT
261
249
  """
262
250
  FEATURE
263
251
 
264
- it "displays the background py string" do
252
+ it 'displays the background py string' do
265
253
  expect(@out.string).to include <<OUTPUT
266
254
  Given stuff:
267
255
  """
@@ -270,7 +258,7 @@ OUTPUT
270
258
  OUTPUT
271
259
  end
272
260
 
273
- it "displays the scenario py string" do
261
+ it 'displays the scenario py string' do
274
262
  expect(@out.string).to include <<OUTPUT
275
263
  Given more stuff:
276
264
  """
@@ -280,7 +268,7 @@ OUTPUT
280
268
  end
281
269
  end
282
270
 
283
- describe "with output from hooks" do
271
+ describe 'with output from hooks' do
284
272
  define_feature <<-FEATURE
285
273
  Feature:
286
274
  Scenario:
@@ -294,18 +282,18 @@ OUTPUT
294
282
 
295
283
  define_steps do
296
284
  Before do
297
- puts "Before hook"
285
+ puts 'Before hook'
298
286
  end
299
287
  AfterStep do
300
- puts "AfterStep hook"
288
+ puts 'AfterStep hook'
301
289
  end
302
290
  After do
303
- puts "After hook"
291
+ puts 'After hook'
304
292
  end
305
- Given(/^this step passes$/) {}
293
+ Given('this step passes') {}
306
294
  end
307
295
 
308
- it "displays hook output appropriately " do
296
+ it 'displays hook output appropriately ' do
309
297
  expect( @out.string ).to include <<OUTPUT
310
298
  Feature:
311
299
 
@@ -328,7 +316,7 @@ OUTPUT
328
316
  end
329
317
  end
330
318
 
331
- describe "with background and output from hooks" do
319
+ describe 'with background and output from hooks' do
332
320
  define_feature <<-FEATURE
333
321
  Feature:
334
322
  Background:
@@ -339,18 +327,18 @@ OUTPUT
339
327
 
340
328
  define_steps do
341
329
  Before do
342
- puts "Before hook"
330
+ puts 'Before hook'
343
331
  end
344
332
  AfterStep do
345
- puts "AfterStep hook"
333
+ puts 'AfterStep hook'
346
334
  end
347
335
  After do
348
- puts "After hook"
336
+ puts 'After hook'
349
337
  end
350
- Given(/^this step passes$/) {}
338
+ Given('this step passes') {}
351
339
  end
352
340
 
353
- it "displays hook output appropriately " do
341
+ it 'displays hook output appropriately ' do
354
342
  expect( @out.string ).to include <<OUTPUT
355
343
  Feature:
356
344
 
@@ -370,7 +358,7 @@ OUTPUT
370
358
  end
371
359
  end
372
360
 
373
- describe "with tags on all levels" do
361
+ describe 'with tags on all levels' do
374
362
  define_feature <<-FEATURE
375
363
  @tag1
376
364
  Feature:
@@ -387,7 +375,7 @@ OUTPUT
387
375
  FEATURE
388
376
 
389
377
 
390
- it "includes the tags in the output " do
378
+ it 'includes the tags in the output ' do
391
379
  expect( @out.string ).to include <<OUTPUT
392
380
  @tag1
393
381
  Feature:
@@ -408,7 +396,7 @@ OUTPUT
408
396
  end
409
397
  end
410
398
 
411
- describe "with comments on all levels" do
399
+ describe 'with comments on all levels' do
412
400
  define_feature <<-FEATURE
413
401
  #comment1
414
402
  Feature:
@@ -435,7 +423,7 @@ OUTPUT
435
423
  FEATURE
436
424
 
437
425
 
438
- it "includes the all comments except for data table rows in the output " do
426
+ it 'includes the all comments except for data table rows in the output ' do
439
427
  expect( @out.string ).to include <<OUTPUT
440
428
  #comment1
441
429
  Feature:
@@ -468,19 +456,19 @@ OUTPUT
468
456
  end
469
457
  end
470
458
 
471
- context "With --no-multiline passed as an option" do
459
+ context 'With --no-multiline passed as an option' do
472
460
  before(:each) do
473
461
  Cucumber::Term::ANSIColor.coloring = false
474
462
  @out = StringIO.new
475
463
  @formatter = Pretty.new(runtime, @out, {:no_multiline => true})
476
464
  end
477
465
 
478
- describe "given a single feature" do
466
+ describe 'given a single feature' do
479
467
  before(:each) do
480
468
  run_defined_feature
481
469
  end
482
470
 
483
- describe "with a scenario" do
471
+ describe 'with a scenario' do
484
472
  define_feature <<-FEATURE
485
473
  Feature: Banana party
486
474
 
@@ -488,16 +476,16 @@ OUTPUT
488
476
  Given there are bananas
489
477
  FEATURE
490
478
 
491
- it "outputs the scenario name" do
492
- expect(@out.string).to include "Scenario: Monkey eats banana"
479
+ it 'outputs the scenario name' do
480
+ expect(@out.string).to include 'Scenario: Monkey eats banana'
493
481
  end
494
482
 
495
- it "outputs the step" do
496
- expect(@out.string).to include "Given there are bananas"
483
+ it 'outputs the step' do
484
+ expect(@out.string).to include 'Given there are bananas'
497
485
  end
498
486
  end
499
487
 
500
- describe "with a scenario outline" do
488
+ describe 'with a scenario outline' do
501
489
  define_feature <<-FEATURE
502
490
  Feature: Fud Pyramid
503
491
 
@@ -514,7 +502,7 @@ OUTPUT
514
502
  | carrots |
515
503
  FEATURE
516
504
 
517
- it "outputs the scenario outline" do
505
+ it 'outputs the scenario outline' do
518
506
  lines = <<-OUTPUT
519
507
  Examples: Fruit
520
508
  | Things |
@@ -530,16 +518,16 @@ OUTPUT
530
518
  end
531
519
  end
532
520
 
533
- it "has 4 undefined scenarios" do
534
- expect(@out.string).to include "4 scenarios (4 undefined)"
521
+ it 'has 4 undefined scenarios' do
522
+ expect(@out.string).to include '4 scenarios (4 undefined)'
535
523
  end
536
524
 
537
- it "has 4 undefined steps" do
538
- expect(@out.string).to include "4 steps (4 undefined)"
525
+ it 'has 4 undefined steps' do
526
+ expect(@out.string).to include '4 steps (4 undefined)'
539
527
  end
540
528
  end
541
529
 
542
- describe "with a step with a py string" do
530
+ describe 'with a step with a py string' do
543
531
  define_feature <<-FEATURE
544
532
  Feature: Traveling circus
545
533
 
@@ -550,7 +538,7 @@ OUTPUT
550
538
  """
551
539
  FEATURE
552
540
 
553
- it "does not display the pystring" do
541
+ it 'does not display the pystring' do
554
542
  expect(@out.string).not_to include <<OUTPUT
555
543
  """
556
544
  foo
@@ -559,7 +547,7 @@ OUTPUT
559
547
  end
560
548
  end
561
549
 
562
- describe "with a multiline step arg" do
550
+ describe 'with a multiline step arg' do
563
551
  define_feature <<-FEATURE
564
552
  Feature: Traveling circus
565
553
 
@@ -570,7 +558,7 @@ OUTPUT
570
558
  | bar |
571
559
  FEATURE
572
560
 
573
- it "does not display the multiline string" do
561
+ it 'does not display the multiline string' do
574
562
  expect(@out.string).not_to include <<OUTPUT
575
563
  | name |
576
564
  | foo |
@@ -579,7 +567,7 @@ OUTPUT
579
567
  end
580
568
  end
581
569
 
582
- describe "with a table in the background and the scenario" do
570
+ describe 'with a table in the background and the scenario' do
583
571
  define_feature <<-FEATURE
584
572
  Feature: accountant monkey
585
573
 
@@ -593,13 +581,13 @@ OUTPUT
593
581
  | g | h |
594
582
  FEATURE
595
583
 
596
- it "does not display the table for the background" do
584
+ it 'does not display the table for the background' do
597
585
  expect(@out.string).not_to include <<OUTPUT
598
586
  | a | b |
599
587
  | c | d |
600
588
  OUTPUT
601
589
  end
602
- it "does not display the table for the scenario" do
590
+ it 'does not display the table for the scenario' do
603
591
  expect(@out.string).not_to include <<OUTPUT
604
592
  | e | f |
605
593
  | g | h |
@@ -607,7 +595,7 @@ OUTPUT
607
595
  end
608
596
  end
609
597
 
610
- describe "with a py string in the background and the scenario" do
598
+ describe 'with a py string in the background and the scenario' do
611
599
  define_feature <<-FEATURE
612
600
  Feature: py strings
613
601
 
@@ -623,14 +611,14 @@ OUTPUT
623
611
  """
624
612
  FEATURE
625
613
 
626
- it "does not display the background py string" do
614
+ it 'does not display the background py string' do
627
615
  expect(@out.string).not_to include <<OUTPUT
628
616
  """
629
617
  foo
630
618
  """
631
619
  OUTPUT
632
620
  end
633
- it "does not display the scenario py string" do
621
+ it 'does not display the scenario py string' do
634
622
  expect(@out.string).not_to include <<OUTPUT
635
623
  """
636
624
  bar
@@ -641,7 +629,7 @@ OUTPUT
641
629
  end
642
630
  end
643
631
 
644
- context "In --expand mode" do
632
+ context 'In --expand mode' do
645
633
  let(:options) { { expand: true } }
646
634
  before(:each) do
647
635
  Cucumber::Term::ANSIColor.coloring = false
@@ -649,12 +637,12 @@ OUTPUT
649
637
  @formatter = Pretty.new(runtime, @out, {})
650
638
  end
651
639
 
652
- describe "given a single feature" do
640
+ describe 'given a single feature' do
653
641
  before(:each) do
654
642
  run_defined_feature
655
643
  end
656
644
 
657
- describe "with a scenario outline" do
645
+ describe 'with a scenario outline' do
658
646
  define_feature <<-FEATURE
659
647
  Feature: Fud Pyramid
660
648
 
@@ -671,7 +659,7 @@ OUTPUT
671
659
  | carrots |
672
660
  FEATURE
673
661
 
674
- it "outputs the instantiated scenarios" do
662
+ it 'outputs the instantiated scenarios' do
675
663
  lines = <<-OUTPUT
676
664
  Examples: Fruit
677
665
  Scenario: | apples |
@@ -690,7 +678,7 @@ OUTPUT
690
678
  end
691
679
  end
692
680
 
693
- describe "with a scenario outline in en-lol" do
681
+ describe 'with a scenario outline in en-lol' do
694
682
  define_feature <<-FEATURE
695
683
  # language: en-lol
696
684
  OH HAI: STUFFING
@@ -706,7 +694,7 @@ OUTPUT
706
694
  | 3 | 2 | 1 |
707
695
  FEATURE
708
696
 
709
- it "outputs localized text" do
697
+ it 'outputs localized text' do
710
698
  lines = <<-OUTPUT
711
699
  OH HAI: STUFFING
712
700
 
@@ -730,7 +718,7 @@ OUTPUT
730
718
  end
731
719
  end
732
720
 
733
- context "In --expand mode with --source as an option" do
721
+ context 'In --expand mode with --source as an option' do
734
722
  let(:options) { { expand: true } }
735
723
  before(:each) do
736
724
  Cucumber::Term::ANSIColor.coloring = false
@@ -738,12 +726,12 @@ OUTPUT
738
726
  @formatter = Pretty.new(runtime, @out, {:source => true})
739
727
  end
740
728
 
741
- describe "given a single feature" do
729
+ describe 'given a single feature' do
742
730
  before(:each) do
743
731
  run_defined_feature
744
732
  end
745
733
 
746
- describe "with a scenario outline" do
734
+ describe 'with a scenario outline' do
747
735
  define_feature <<-FEATURE
748
736
  Feature: Fud Pyramid
749
737
 
@@ -760,7 +748,7 @@ OUTPUT
760
748
  | carrots |
761
749
  FEATURE
762
750
 
763
- it "includes the source in the output" do
751
+ it 'includes the source in the output' do
764
752
  lines = <<-OUTPUT
765
753
  Scenario Outline: Monkey eats a balanced diet # spec.feature:3
766
754
  Given there are <Things> # spec.feature:4
@@ -780,7 +768,7 @@ OUTPUT
780
768
  end
781
769
  end
782
770
 
783
- context "With very wide cells" do
771
+ context 'With very wide cells' do
784
772
  define_feature <<-FEATURE
785
773
  Feature: Monkey Business
786
774
 
@@ -792,7 +780,7 @@ OUTPUT
792
780
  | Hominidae | Very long cell content |
793
781
  FEATURE
794
782
 
795
- it "the scenario line controls the source indentation" do
783
+ it 'the scenario line controls the source indentation' do
796
784
  lines = <<-OUTPUT
797
785
  Examples:
798
786
  Scenario: | Hominidae | Very long cell content | # spec.feature:8
@@ -808,7 +796,7 @@ OUTPUT
808
796
  end
809
797
  end
810
798
 
811
- context "snippets contain relevant keyword replacements" do
799
+ context 'snippets contain relevant keyword replacements' do
812
800
 
813
801
  before(:each) do
814
802
  Cucumber::Term::ANSIColor.coloring = false
@@ -817,7 +805,7 @@ OUTPUT
817
805
  run_defined_feature
818
806
  end
819
807
 
820
- describe "With a scenario that has undefined steps" do
808
+ describe 'With a scenario that has undefined steps' do
821
809
  define_feature <<-FEATURE
822
810
  Feature: Banana party
823
811
 
@@ -831,12 +819,12 @@ OUTPUT
831
819
  FEATURE
832
820
 
833
821
  it "containes snippets with 'And' or 'But' replaced by previous step name" do
834
- expect(@out.string).to include("Given(/^there are bananas and apples$/)")
835
- expect(@out.string).to include("Given(/^other monkeys are around$/)")
836
- expect(@out.string).to include("When(/^one monkey eats a banana$/)")
837
- expect(@out.string).to include("When(/^the other monkeys eat all the apples$/)")
838
- expect(@out.string).to include("Then(/^bananas remain$/)")
839
- expect(@out.string).to include("Then(/^there are no apples left$/)")
822
+ expect(@out.string).to include('Given("there are bananas and apples")')
823
+ expect(@out.string).to include('Given("other monkeys are around")')
824
+ expect(@out.string).to include('When("one monkey eats a banana")')
825
+ expect(@out.string).to include('When("the other monkeys eat all the apples")')
826
+ expect(@out.string).to include('Then("bananas remain")')
827
+ expect(@out.string).to include('Then("there are no apples left")')
840
828
  end
841
829
  end
842
830
 
@@ -853,12 +841,12 @@ OUTPUT
853
841
  * there are no apples left
854
842
  FEATURE
855
843
  it "replaces the first step with 'Given'" do
856
- expect(@out.string).to include("Given(/^there are bananas and apples$/)")
844
+ expect(@out.string).to include('Given("there are bananas and apples")')
857
845
  end
858
846
  it "uses actual keywords as the 'previous' keyword for future replacements" do
859
- expect(@out.string).to include("Given(/^other monkeys are around$/)")
860
- expect(@out.string).to include("When(/^the other monkeys eat all the apples$/)")
861
- expect(@out.string).to include("Then(/^there are no apples left$/)")
847
+ expect(@out.string).to include('Given("other monkeys are around")')
848
+ expect(@out.string).to include('When("the other monkeys eat all the apples")')
849
+ expect(@out.string).to include('Then("there are no apples left")')
862
850
  end
863
851
  end
864
852
 
@@ -872,10 +860,10 @@ OUTPUT
872
860
  And this step is undefined
873
861
  FEATURE
874
862
  define_steps do
875
- Given(/^this step passes$/) {}
863
+ Given('this step passes') {}
876
864
  end
877
- it "uses actual keyword of the previous passing step for the undefined step" do
878
- expect(@out.string).to include("Then(/^this step is undefined$/)")
865
+ it 'uses actual keyword of the previous passing step for the undefined step' do
866
+ expect(@out.string).to include('Then("this step is undefined")')
879
867
  end
880
868
  end
881
869
 
@@ -892,15 +880,15 @@ OUTPUT
892
880
  Then this step passes
893
881
  FEATURE
894
882
  define_steps do
895
- Given(/^this step passes$/) {}
883
+ Given('this step passes') {}
896
884
  end
897
885
  it "uses 'Given' as actual keyword the step in each scenario" do
898
- expect(@out.string).to include("Given(/^this step is undefined$/)")
899
- expect(@out.string).to include("Given(/^this step is also undefined$/)")
886
+ expect(@out.string).to include('Given("this step is undefined")')
887
+ expect(@out.string).to include('Given("this step is also undefined")')
900
888
  end
901
889
  end
902
890
 
903
- describe "with a scenario in en-lol" do
891
+ describe 'with a scenario in en-lol' do
904
892
  define_feature <<-FEATURE
905
893
  # language: en-lol
906
894
  OH HAI: STUFFING
@@ -909,8 +897,8 @@ OUTPUT
909
897
  I CAN HAZ IN TEH BEGINNIN CUCUMBRZ
910
898
  AN I EAT CUCUMBRZ
911
899
  FEATURE
912
- it "uses actual keyword of the previous passing step for the undefined step" do
913
- expect(@out.string).to include("ICANHAZ(/^I EAT CUCUMBRZ$/)")
900
+ it 'uses actual keyword of the previous passing step for the undefined step' do
901
+ expect(@out.string).to include('ICANHAZ("I EAT CUCUMBRZ")')
914
902
  end
915
903
  end
916
904
  end