cucumber 3.0.1 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (517) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +84 -4
  3. data/CONTRIBUTING.md +3 -4
  4. data/README.md +12 -12
  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 +63 -55
  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 +8 -7
  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 +2 -1
  25. data/lib/cucumber/events.rb +1 -2
  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 -6
  34. data/lib/cucumber/events/test_step_started.rb +1 -7
  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 -4
  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 +11 -12
  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 +28 -32
  62. data/lib/cucumber/formatter/html_builder.rb +3 -2
  63. data/lib/cucumber/formatter/http_io.rb +146 -0
  64. data/lib/cucumber/formatter/ignore_missing_messages.rb +1 -3
  65. data/lib/cucumber/formatter/interceptor.rb +18 -5
  66. data/lib/cucumber/formatter/io.rb +18 -11
  67. data/lib/cucumber/formatter/json.rb +11 -4
  68. data/lib/cucumber/formatter/json_pretty.rb +1 -1
  69. data/lib/cucumber/formatter/junit.rb +22 -17
  70. data/lib/cucumber/formatter/pretty.rb +4 -3
  71. data/lib/cucumber/formatter/progress.rb +3 -2
  72. data/lib/cucumber/formatter/rerun.rb +2 -1
  73. data/lib/cucumber/formatter/stepdefs.rb +1 -0
  74. data/lib/cucumber/formatter/steps.rb +2 -2
  75. data/lib/cucumber/formatter/summary.rb +1 -2
  76. data/lib/cucumber/formatter/unicode.rb +2 -2
  77. data/lib/cucumber/formatter/usage.rb +22 -19
  78. data/lib/cucumber/gherkin/data_table_parser.rb +1 -0
  79. data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +86 -85
  80. data/lib/cucumber/gherkin/formatter/escaping.rb +13 -12
  81. data/lib/cucumber/gherkin/i18n.rb +1 -0
  82. data/lib/cucumber/gherkin/steps_parser.rb +1 -0
  83. data/lib/cucumber/glue/dsl.rb +1 -0
  84. data/lib/cucumber/glue/hook.rb +1 -0
  85. data/lib/cucumber/glue/invoke_in_world.rb +3 -3
  86. data/lib/cucumber/glue/proto_world.rb +10 -9
  87. data/lib/cucumber/glue/registry_and_more.rb +13 -12
  88. data/lib/cucumber/glue/snippet.rb +1 -5
  89. data/lib/cucumber/glue/step_definition.rb +10 -10
  90. data/lib/cucumber/glue/world_factory.rb +1 -3
  91. data/lib/cucumber/hooks.rb +13 -3
  92. data/lib/cucumber/load_path.rb +1 -0
  93. data/lib/cucumber/multiline_argument.rb +3 -3
  94. data/lib/cucumber/multiline_argument/data_table.rb +16 -20
  95. data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +7 -11
  96. data/lib/cucumber/multiline_argument/doc_string.rb +1 -0
  97. data/lib/cucumber/platform.rb +2 -1
  98. data/lib/cucumber/project_initializer.rb +1 -1
  99. data/lib/cucumber/rake/task.rb +8 -5
  100. data/lib/cucumber/rspec/disable_option_parser.rb +1 -0
  101. data/lib/cucumber/rspec/doubles.rb +1 -0
  102. data/lib/cucumber/running_test_case.rb +2 -1
  103. data/lib/cucumber/runtime.rb +6 -6
  104. data/lib/cucumber/runtime/after_hooks.rb +1 -0
  105. data/lib/cucumber/runtime/before_hooks.rb +1 -0
  106. data/lib/cucumber/runtime/for_programming_languages.rb +8 -7
  107. data/lib/cucumber/runtime/step_hooks.rb +2 -0
  108. data/lib/cucumber/runtime/support_code.rb +3 -7
  109. data/lib/cucumber/runtime/user_interface.rb +2 -3
  110. data/lib/cucumber/step_argument.rb +1 -0
  111. data/lib/cucumber/step_definition_light.rb +2 -1
  112. data/lib/cucumber/step_definitions.rb +2 -1
  113. data/lib/cucumber/step_match.rb +9 -8
  114. data/lib/cucumber/step_match_search.rb +8 -9
  115. data/lib/cucumber/term/ansicolor.rb +30 -30
  116. data/lib/cucumber/unit.rb +1 -0
  117. data/lib/cucumber/version +1 -1
  118. data/lib/simplecov_setup.rb +1 -0
  119. metadata +64 -659
  120. data/.coveralls.yml +0 -1
  121. data/.cucumberproignore +0 -6
  122. data/.gitattributes +0 -32
  123. data/.github/ISSUE_TEMPLATE.md +0 -48
  124. data/.github/PULL_REQUEST_TEMPLATE.md +0 -40
  125. data/.rspec +0 -1
  126. data/.rubocop.yml +0 -13
  127. data/.rubocop_todo.yml +0 -991
  128. data/.ruby-gemset +0 -1
  129. data/.travis.yml +0 -70
  130. data/.yardopts +0 -1
  131. data/Gemfile +0 -28
  132. data/Rakefile +0 -32
  133. data/appveyor.yml +0 -27
  134. data/cucumber.gemspec +0 -52
  135. data/cucumber.yml +0 -19
  136. data/examples/i18n/README.textile +0 -3
  137. data/examples/i18n/Rakefile +0 -33
  138. data/examples/i18n/ar/Rakefile +0 -6
  139. data/examples/i18n/ar/features/addition.feature +0 -17
  140. data/examples/i18n/ar/features/step_definitions/calculator_steps.rb +0 -29
  141. data/examples/i18n/ar/lib/calculator.rb +0 -11
  142. data/examples/i18n/bg/Rakefile +0 -6
  143. data/examples/i18n/bg/features/addition.feature +0 -12
  144. data/examples/i18n/bg/features/consecutive_calculations.feature +0 -19
  145. data/examples/i18n/bg/features/division.feature +0 -17
  146. data/examples/i18n/bg/features/step_definitions/calculator_steps.rb +0 -24
  147. data/examples/i18n/bg/features/support/env.rb +0 -10
  148. data/examples/i18n/bg/features/support/world.rb +0 -8
  149. data/examples/i18n/bg/lib/calculator.rb +0 -25
  150. data/examples/i18n/ca/Rakefile +0 -6
  151. data/examples/i18n/ca/features/step_definitions/calculator_steps.rb +0 -26
  152. data/examples/i18n/ca/features/suma.feature +0 -17
  153. data/examples/i18n/ca/lib/calculadora.rb +0 -16
  154. data/examples/i18n/cs/Rakefile +0 -6
  155. data/examples/i18n/cs/features/addition.feature +0 -17
  156. data/examples/i18n/cs/features/division.feature +0 -11
  157. data/examples/i18n/cs/features/step_definitions/calculator_steps.rb +0 -29
  158. data/examples/i18n/cs/lib/calculator.rb +0 -14
  159. data/examples/i18n/da/Rakefile +0 -6
  160. data/examples/i18n/da/features/sammenlaegning.feature +0 -18
  161. data/examples/i18n/da/features/step_definitions/lommeregner_steps.rb +0 -29
  162. data/examples/i18n/da/lib/lommeregner.rb +0 -11
  163. data/examples/i18n/de/Rakefile +0 -6
  164. data/examples/i18n/de/features/addition.feature +0 -17
  165. data/examples/i18n/de/features/division.feature +0 -10
  166. data/examples/i18n/de/features/step_definitions/calculator_steps.rb +0 -29
  167. data/examples/i18n/de/lib/calculator.rb +0 -14
  168. data/examples/i18n/el/Rakefile +0 -6
  169. data/examples/i18n/el/features/addition.feature +0 -17
  170. data/examples/i18n/el/features/division.feature +0 -10
  171. data/examples/i18n/el/features/step_definitions/calculator_steps.rb +0 -29
  172. data/examples/i18n/el/lib/calculator.rb +0 -14
  173. data/examples/i18n/en-lol/Rakefile +0 -4
  174. data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +0 -16
  175. data/examples/i18n/en-lol/features/stuffing.feature +0 -8
  176. data/examples/i18n/en-lol/features/support/env.rb +0 -11
  177. data/examples/i18n/en-lol/lib/basket.rb +0 -12
  178. data/examples/i18n/en-lol/lib/belly.rb +0 -11
  179. data/examples/i18n/en/Rakefile +0 -6
  180. data/examples/i18n/en/features/addition.feature +0 -17
  181. data/examples/i18n/en/features/division.feature +0 -10
  182. data/examples/i18n/en/features/step_definitions/calculator_steps.rb +0 -29
  183. data/examples/i18n/en/lib/calculator.rb +0 -14
  184. data/examples/i18n/eo/Rakefile +0 -6
  185. data/examples/i18n/eo/features/adicio.feature +0 -17
  186. data/examples/i18n/eo/features/divido.feature +0 -10
  187. data/examples/i18n/eo/features/step_definitions/calculator_steps.rb +0 -29
  188. data/examples/i18n/eo/lib/calculator.rb +0 -14
  189. data/examples/i18n/es/Rakefile +0 -6
  190. data/examples/i18n/es/features/adicion.feature +0 -17
  191. data/examples/i18n/es/features/step_definitions/calculador_steps.rb +0 -26
  192. data/examples/i18n/es/lib/calculador.rb +0 -14
  193. data/examples/i18n/et/Rakefile +0 -6
  194. data/examples/i18n/et/features/jagamine.feature +0 -10
  195. data/examples/i18n/et/features/liitmine.feature +0 -17
  196. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +0 -29
  197. data/examples/i18n/et/lib/kalkulaator.rb +0 -14
  198. data/examples/i18n/fi/Rakefile +0 -6
  199. data/examples/i18n/fi/features/jakolasku.feature +0 -10
  200. data/examples/i18n/fi/features/step_definitions/laskin_steps.rb +0 -29
  201. data/examples/i18n/fi/features/yhteenlasku.feature +0 -17
  202. data/examples/i18n/fi/lib/laskin.rb +0 -14
  203. data/examples/i18n/fr/Rakefile +0 -8
  204. data/examples/i18n/fr/features/addition.feature +0 -18
  205. data/examples/i18n/fr/features/addition2.feature +0 -17
  206. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +0 -32
  207. data/examples/i18n/fr/features/support/env.rb +0 -10
  208. data/examples/i18n/fr/lib/calculatrice.rb +0 -10
  209. data/examples/i18n/he/Rakefile +0 -6
  210. data/examples/i18n/he/features/addition.feature +0 -17
  211. data/examples/i18n/he/features/division.feature +0 -10
  212. data/examples/i18n/he/features/step_definitions/calculator_steps.rb +0 -29
  213. data/examples/i18n/he/lib/calculator.rb +0 -15
  214. data/examples/i18n/hi/Rakefile +0 -6
  215. data/examples/i18n/hi/features/addition.feature +0 -16
  216. data/examples/i18n/hi/features/division.feature +0 -10
  217. data/examples/i18n/hi/features/step_definitions/calculator_steps.rb +0 -29
  218. data/examples/i18n/hi/lib/calculator.rb +0 -15
  219. data/examples/i18n/ht/Rakefile +0 -6
  220. data/examples/i18n/ht/features/adisyon.feature +0 -17
  221. data/examples/i18n/ht/features/divizyon.feature +0 -10
  222. data/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb +0 -29
  223. data/examples/i18n/ht/lib/kalkilatris.rb +0 -14
  224. data/examples/i18n/hu/Rakefile +0 -6
  225. data/examples/i18n/hu/features/osszeadas.feature +0 -17
  226. data/examples/i18n/hu/features/osztas.feature +0 -10
  227. data/examples/i18n/hu/features/step_definitions/calculator_steps.rb +0 -30
  228. data/examples/i18n/hu/lib/calculator.rb +0 -14
  229. data/examples/i18n/id/Rakefile +0 -6
  230. data/examples/i18n/id/features/addition.feature +0 -17
  231. data/examples/i18n/id/features/division.feature +0 -10
  232. data/examples/i18n/id/features/step_definitions/calculator_steps.rb +0 -29
  233. data/examples/i18n/id/lib/calculator.rb +0 -14
  234. data/examples/i18n/it/Rakefile +0 -6
  235. data/examples/i18n/it/features/somma.feature +0 -11
  236. data/examples/i18n/it/features/step_definitions/calcolatrice_steps.rb +0 -29
  237. data/examples/i18n/it/lib/calcolatrice.rb +0 -11
  238. data/examples/i18n/ja/Rakefile +0 -6
  239. data/examples/i18n/ja/features/addition.feature +0 -17
  240. data/examples/i18n/ja/features/division.feature +0 -10
  241. data/examples/i18n/ja/features/step_definitions/calculator_steps.rb +0 -19
  242. data/examples/i18n/ja/features/support/env.rb +0 -10
  243. data/examples/i18n/ja/lib/calculator.rb +0 -14
  244. data/examples/i18n/ko/Rakefile +0 -6
  245. data/examples/i18n/ko/features/addition.feature +0 -17
  246. data/examples/i18n/ko/features/division.feature +0 -11
  247. data/examples/i18n/ko/features/step_definitions/calculator_steps.rb +0 -29
  248. data/examples/i18n/ko/lib/calculator.rb +0 -14
  249. data/examples/i18n/lt/Rakefile +0 -6
  250. data/examples/i18n/lt/features/addition.feature +0 -17
  251. data/examples/i18n/lt/features/division.feature +0 -10
  252. data/examples/i18n/lt/features/step_definitions/calculator_steps.rb +0 -29
  253. data/examples/i18n/lt/lib/calculator.rb +0 -14
  254. data/examples/i18n/lv/Rakefile +0 -6
  255. data/examples/i18n/lv/features/addition.feature +0 -17
  256. data/examples/i18n/lv/features/division.feature +0 -10
  257. data/examples/i18n/lv/features/step_definitions/calculator_steps.rb +0 -29
  258. data/examples/i18n/lv/lib/calculator.rb +0 -14
  259. data/examples/i18n/no/Rakefile +0 -6
  260. data/examples/i18n/no/features/step_definitions/kalkulator_steps.rb +0 -17
  261. data/examples/i18n/no/features/summering.feature +0 -19
  262. data/examples/i18n/no/features/support/env.rb +0 -11
  263. data/examples/i18n/no/lib/kalkulator.rb +0 -11
  264. data/examples/i18n/pl/Rakefile +0 -6
  265. data/examples/i18n/pl/features/addition.feature +0 -17
  266. data/examples/i18n/pl/features/division.feature +0 -10
  267. data/examples/i18n/pl/features/step_definitions/calculator_steps.rb +0 -29
  268. data/examples/i18n/pl/features/support/env.rb +0 -10
  269. data/examples/i18n/pl/lib/calculator.rb +0 -14
  270. data/examples/i18n/pt/Rakefile +0 -6
  271. data/examples/i18n/pt/features/adicao.feature +0 -11
  272. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +0 -20
  273. data/examples/i18n/pt/features/support/env.rb +0 -10
  274. data/examples/i18n/pt/lib/calculadora.rb +0 -10
  275. data/examples/i18n/ro/Rakefile +0 -6
  276. data/examples/i18n/ro/features/adunare.feature +0 -12
  277. data/examples/i18n/ro/features/step_definitions/calculator_steps.rb +0 -26
  278. data/examples/i18n/ro/lib/calculator.rb +0 -11
  279. data/examples/i18n/ru/Rakefile +0 -6
  280. data/examples/i18n/ru/features/addition.feature +0 -11
  281. data/examples/i18n/ru/features/consecutive_calculations.feature +0 -17
  282. data/examples/i18n/ru/features/division.feature +0 -16
  283. data/examples/i18n/ru/features/step_definitions/calculator_steps.rb +0 -19
  284. data/examples/i18n/ru/features/support/env.rb +0 -10
  285. data/examples/i18n/ru/features/support/world.rb +0 -8
  286. data/examples/i18n/ru/lib/calculator.rb +0 -25
  287. data/examples/i18n/sk/Rakefile +0 -6
  288. data/examples/i18n/sk/features/addition.feature +0 -17
  289. data/examples/i18n/sk/features/division.feature +0 -10
  290. data/examples/i18n/sk/features/step_definitions/calculator_steps.rb +0 -29
  291. data/examples/i18n/sk/lib/calculator.rb +0 -14
  292. data/examples/i18n/sr-Cyrl/Rakefile +0 -6
  293. data/examples/i18n/sr-Cyrl/features/sabiranje.feature +0 -18
  294. data/examples/i18n/sr-Cyrl/features/step_definitions/calculator_steps.rb +0 -20
  295. data/examples/i18n/sr-Cyrl/features/support/env.rb +0 -10
  296. data/examples/i18n/sr-Cyrl/lib/calculator.rb +0 -12
  297. data/examples/i18n/sr-Latn/Rakefile +0 -6
  298. data/examples/i18n/sr-Latn/features/sabiranje.feature +0 -18
  299. data/examples/i18n/sr-Latn/features/step_definitions/calculator_steps.rb +0 -29
  300. data/examples/i18n/sr-Latn/lib/calculator.rb +0 -12
  301. data/examples/i18n/sv/Rakefile +0 -6
  302. data/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb +0 -29
  303. data/examples/i18n/sv/features/summering.feature +0 -18
  304. data/examples/i18n/sv/lib/kalkulator.rb +0 -11
  305. data/examples/i18n/tr/Rakefile +0 -6
  306. data/examples/i18n/tr/features/bolme.feature +0 -10
  307. data/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb +0 -29
  308. data/examples/i18n/tr/features/toplama.feature +0 -18
  309. data/examples/i18n/tr/lib/hesap_makinesi.rb +0 -15
  310. data/examples/i18n/uk/Rakefile +0 -6
  311. data/examples/i18n/uk/features/addition.feature +0 -11
  312. data/examples/i18n/uk/features/consecutive_calculations.feature +0 -17
  313. data/examples/i18n/uk/features/division.feature +0 -16
  314. data/examples/i18n/uk/features/step_definitions/calculator_steps.rb +0 -19
  315. data/examples/i18n/uk/features/support/env.rb +0 -10
  316. data/examples/i18n/uk/features/support/world.rb +0 -8
  317. data/examples/i18n/uk/lib/calculator.rb +0 -25
  318. data/examples/i18n/uz/Rakefile +0 -6
  319. data/examples/i18n/uz/features/addition.feature +0 -10
  320. data/examples/i18n/uz/features/consecutive_calculations.feature +0 -17
  321. data/examples/i18n/uz/features/division.feature +0 -17
  322. data/examples/i18n/uz/features/step_definitions/calculator_steps.rb +0 -19
  323. data/examples/i18n/uz/features/support/env.rb +0 -10
  324. data/examples/i18n/uz/features/support/world.rb +0 -8
  325. data/examples/i18n/uz/lib/calculator.rb +0 -25
  326. data/examples/i18n/zh-CN/Rakefile +0 -4
  327. data/examples/i18n/zh-CN/features/addition.feature +0 -18
  328. data/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb +0 -31
  329. data/examples/i18n/zh-CN/lib/calculator.rb +0 -10
  330. data/examples/i18n/zh-TW/Rakefile +0 -4
  331. data/examples/i18n/zh-TW/features/addition.feature +0 -17
  332. data/examples/i18n/zh-TW/features/division.feature +0 -11
  333. data/examples/i18n/zh-TW/features/step_definitions/calculator_steps.rb +0 -29
  334. data/examples/i18n/zh-TW/lib/calculator.rb +0 -14
  335. data/examples/rspec_doubles/Rakefile +0 -4
  336. data/examples/rspec_doubles/features/mocking.feature +0 -9
  337. data/examples/rspec_doubles/features/step_definitions/calvin_steps.rb +0 -19
  338. data/examples/rspec_doubles/features/support/env.rb +0 -12
  339. data/examples/sinatra/README.textile +0 -13
  340. data/examples/sinatra/Rakefile +0 -6
  341. data/examples/sinatra/app.rb +0 -14
  342. data/examples/sinatra/features/add.feature +0 -11
  343. data/examples/sinatra/features/step_definitions/add_steps.rb +0 -15
  344. data/examples/sinatra/features/support/env.rb +0 -15
  345. data/examples/sinatra/views/add.erb +0 -7
  346. data/examples/sinatra/views/layout.erb +0 -8
  347. data/examples/tcl/README.textile +0 -11
  348. data/examples/tcl/Rakefile +0 -6
  349. data/examples/tcl/features/fibonnacci.feature +0 -17
  350. data/examples/tcl/features/step_definitions/fib_steps.rb +0 -7
  351. data/examples/tcl/features/support/env.rb +0 -7
  352. data/examples/tcl/src/fib.tcl +0 -3
  353. data/examples/test_unit/Gemfile +0 -4
  354. data/examples/test_unit/Rakefile +0 -6
  355. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +0 -20
  356. data/examples/test_unit/features/test_unit.feature +0 -9
  357. data/examples/watir/README.textile +0 -16
  358. data/examples/watir/Rakefile +0 -12
  359. data/examples/watir/cucumber.yml +0 -1
  360. data/examples/watir/features/search.feature +0 -12
  361. data/examples/watir/features/step_definitions/search_steps.rb +0 -27
  362. data/examples/watir/features/support/env.rb +0 -39
  363. data/examples/watir/features/support/screenshots.rb +0 -47
  364. data/features/docs/api/list_step_defs_as_json.feature +0 -64
  365. data/features/docs/api/listen_for_events.feature +0 -59
  366. data/features/docs/api/run_cli_main_with_existing_runtime.feature +0 -27
  367. data/features/docs/cli/backtraces.feature +0 -36
  368. data/features/docs/cli/dry_run.feature +0 -73
  369. data/features/docs/cli/exclude_files.feature +0 -18
  370. data/features/docs/cli/execute_with_tag_filter.feature +0 -119
  371. data/features/docs/cli/fail_fast.feature +0 -48
  372. data/features/docs/cli/finding_steps.feature +0 -28
  373. data/features/docs/cli/help.feature +0 -8
  374. data/features/docs/cli/i18n.feature +0 -42
  375. data/features/docs/cli/randomize.feature +0 -140
  376. data/features/docs/cli/require.feature +0 -27
  377. data/features/docs/cli/retry_failing_tests.feature +0 -92
  378. data/features/docs/cli/run_scenarios_matching_name.feature +0 -105
  379. data/features/docs/cli/run_specific_scenarios.feature +0 -77
  380. data/features/docs/cli/showing_differences.feature +0 -43
  381. data/features/docs/cli/specifying_multiple_formatters.feature +0 -68
  382. data/features/docs/cli/strict_mode.feature +0 -70
  383. data/features/docs/defining_steps/ambiguous_steps.feature +0 -89
  384. data/features/docs/defining_steps/nested_steps.feature +0 -181
  385. data/features/docs/defining_steps/nested_steps_i18n.feature +0 -37
  386. data/features/docs/defining_steps/nested_steps_with_second_arg.feature +0 -56
  387. data/features/docs/defining_steps/one_line_step_definitions.feature +0 -65
  388. data/features/docs/defining_steps/printing_messages.feature +0 -147
  389. data/features/docs/defining_steps/skip_scenario.feature +0 -31
  390. data/features/docs/defining_steps/snippets.feature +0 -56
  391. data/features/docs/defining_steps/table_diffing.feature +0 -50
  392. data/features/docs/events/gherkin_source_read_event.feature +0 -43
  393. data/features/docs/events/step_activated_event.feature +0 -36
  394. data/features/docs/events/step_definition_registered_event.feature +0 -29
  395. data/features/docs/events/test_case_finished_event.feature +0 -35
  396. data/features/docs/events/test_case_started_event.feature +0 -54
  397. data/features/docs/events/test_run_finished_event.feature +0 -40
  398. data/features/docs/events/test_run_started_event.feature +0 -41
  399. data/features/docs/events/test_step_finished_event.feature +0 -47
  400. data/features/docs/events/test_step_started_event.feature +0 -43
  401. data/features/docs/exception_in_after_hook.feature +0 -127
  402. data/features/docs/exception_in_after_step_hook.feature +0 -104
  403. data/features/docs/exception_in_around_hook.feature +0 -80
  404. data/features/docs/exception_in_before_hook.feature +0 -98
  405. data/features/docs/extending_cucumber/custom_filter.feature +0 -29
  406. data/features/docs/extending_cucumber/custom_formatter.feature +0 -94
  407. data/features/docs/formatters/api_methods.feature +0 -37
  408. data/features/docs/formatters/html_formatter.feature +0 -91
  409. data/features/docs/formatters/json_formatter.feature +0 -767
  410. data/features/docs/formatters/junit_formatter.feature +0 -455
  411. data/features/docs/formatters/pretty_formatter.feature +0 -74
  412. data/features/docs/formatters/progress_formatter.feature +0 -32
  413. data/features/docs/formatters/rerun_formatter.feature +0 -190
  414. data/features/docs/formatters/summary_formatter.feature +0 -35
  415. data/features/docs/formatters/usage_formatter.feature +0 -101
  416. data/features/docs/getting_started.feature +0 -28
  417. data/features/docs/gherkin/background.feature +0 -548
  418. data/features/docs/gherkin/doc_strings.feature +0 -76
  419. data/features/docs/gherkin/expand_option_for_outlines.feature +0 -47
  420. data/features/docs/gherkin/language_from_header.feature +0 -32
  421. data/features/docs/gherkin/outlines.feature +0 -158
  422. data/features/docs/gherkin/unicode_table.feature +0 -33
  423. data/features/docs/gherkin/using_descriptions.feature +0 -83
  424. data/features/docs/gherkin/using_star_notation.feature +0 -37
  425. data/features/docs/iso-8859-1.feature +0 -6
  426. data/features/docs/post_configuration_hook.feature +0 -33
  427. data/features/docs/profiles.feature +0 -120
  428. data/features/docs/rake_task.feature +0 -146
  429. data/features/docs/raketask.feature +0 -46
  430. data/features/docs/work_in_progress.feature +0 -157
  431. data/features/docs/writing_support_code/after_hooks.feature +0 -102
  432. data/features/docs/writing_support_code/after_step_hooks.feature +0 -55
  433. data/features/docs/writing_support_code/around_hooks.feature +0 -266
  434. data/features/docs/writing_support_code/before_hook.feature +0 -66
  435. data/features/docs/writing_support_code/hook_order.feature +0 -63
  436. data/features/docs/writing_support_code/load_path.feature +0 -17
  437. data/features/docs/writing_support_code/parameter_types.feature +0 -69
  438. data/features/docs/writing_support_code/state.feature +0 -32
  439. data/features/docs/writing_support_code/tagged_hooks.feature +0 -95
  440. data/features/docs/writing_support_code/world.feature +0 -129
  441. data/features/lib/step_definitions/aruba_steps.rb +0 -21
  442. data/features/lib/step_definitions/cli_steps.rb +0 -4
  443. data/features/lib/step_definitions/cucumber_steps.rb +0 -75
  444. data/features/lib/step_definitions/iso-8859-1_steps.rb +0 -16
  445. data/features/lib/step_definitions/json_steps.rb +0 -8
  446. data/features/lib/step_definitions/junit_steps.rb +0 -14
  447. data/features/lib/step_definitions/language_steps.rb +0 -9
  448. data/features/lib/step_definitions/profile_steps.rb +0 -16
  449. data/features/lib/step_definitions/retry_steps.rb +0 -55
  450. data/features/lib/step_definitions/ruby_steps.rb +0 -4
  451. data/features/lib/support/env.rb +0 -22
  452. data/features/lib/support/fake_wire_server.rb +0 -94
  453. data/features/lib/support/feature_factory.rb +0 -68
  454. data/features/lib/support/normalise_output.rb +0 -52
  455. data/features/lib/support/parameter_types.rb +0 -5
  456. data/gem_tasks/contributors.rake +0 -19
  457. data/gem_tasks/cov.rake +0 -6
  458. data/gem_tasks/downloads.rb +0 -8
  459. data/gem_tasks/environment.rake +0 -4
  460. data/gem_tasks/examples.rake +0 -12
  461. data/gem_tasks/fix_cr_lf.rake +0 -22
  462. data/gem_tasks/flog.rake +0 -5
  463. data/gem_tasks/rspec.rake +0 -7
  464. data/gem_tasks/sass.rake +0 -5
  465. data/gem_tasks/stats +0 -16
  466. data/gem_tasks/versions.txt +0 -74
  467. data/scripts/invite-collaborator +0 -40
  468. data/scripts/update-changelog +0 -86
  469. data/spec/cucumber/cli/configuration_spec.rb +0 -446
  470. data/spec/cucumber/cli/main_spec.rb +0 -84
  471. data/spec/cucumber/cli/options_spec.rb +0 -445
  472. data/spec/cucumber/cli/profile_loader_spec.rb +0 -66
  473. data/spec/cucumber/cli/rerun_spec.rb +0 -86
  474. data/spec/cucumber/configuration_spec.rb +0 -148
  475. data/spec/cucumber/constantize_spec.rb +0 -20
  476. data/spec/cucumber/events_spec.rb +0 -9
  477. data/spec/cucumber/file_specs_spec.rb +0 -61
  478. data/spec/cucumber/filters/activate_steps_spec.rb +0 -152
  479. data/spec/cucumber/filters/gated_receiver_spec.rb +0 -48
  480. data/spec/cucumber/filters/retry_spec.rb +0 -98
  481. data/spec/cucumber/filters/tag_limits/test_case_index_spec.rb +0 -39
  482. data/spec/cucumber/filters/tag_limits/verifier_spec.rb +0 -58
  483. data/spec/cucumber/filters/tag_limits_spec.rb +0 -60
  484. data/spec/cucumber/formatter/ansicolor_spec.rb +0 -33
  485. data/spec/cucumber/formatter/backtrace_filter_spec.rb +0 -32
  486. data/spec/cucumber/formatter/console_counts_spec.rb +0 -14
  487. data/spec/cucumber/formatter/duration_spec.rb +0 -23
  488. data/spec/cucumber/formatter/fail_fast_spec.rb +0 -88
  489. data/spec/cucumber/formatter/html_spec.rb +0 -543
  490. data/spec/cucumber/formatter/interceptor_spec.rb +0 -137
  491. data/spec/cucumber/formatter/json_spec.rb +0 -815
  492. data/spec/cucumber/formatter/junit_spec.rb +0 -251
  493. data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +0 -2175
  494. data/spec/cucumber/formatter/pretty_spec.rb +0 -907
  495. data/spec/cucumber/formatter/progress_spec.rb +0 -170
  496. data/spec/cucumber/formatter/rerun_spec.rb +0 -97
  497. data/spec/cucumber/formatter/spec_helper.rb +0 -84
  498. data/spec/cucumber/glue/proto_world_spec.rb +0 -63
  499. data/spec/cucumber/glue/registry_and_more_spec.rb +0 -213
  500. data/spec/cucumber/glue/snippet_spec.rb +0 -174
  501. data/spec/cucumber/glue/step_definition_spec.rb +0 -207
  502. data/spec/cucumber/hooks_spec.rb +0 -31
  503. data/spec/cucumber/multiline_argument/data_table_spec.rb +0 -653
  504. data/spec/cucumber/project_initializer_spec.rb +0 -88
  505. data/spec/cucumber/rake/forked_spec.rb +0 -58
  506. data/spec/cucumber/rake/task_spec.rb +0 -86
  507. data/spec/cucumber/running_test_case_spec.rb +0 -140
  508. data/spec/cucumber/runtime/for_programming_languages_spec.rb +0 -8
  509. data/spec/cucumber/runtime/support_code_spec.rb +0 -17
  510. data/spec/cucumber/runtime_spec.rb +0 -21
  511. data/spec/cucumber/sell_cucumbers.feature +0 -19
  512. data/spec/cucumber/step_argument_spec.rb +0 -19
  513. data/spec/cucumber/step_match_search_spec.rb +0 -113
  514. data/spec/cucumber/step_match_spec.rb +0 -86
  515. data/spec/cucumber/world/pending_spec.rb +0 -48
  516. data/spec/spec_helper.rb +0 -30
  517. data/spec/support/standard_step_actions.rb +0 -19
@@ -1,251 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'spec_helper'
3
- require 'cucumber/formatter/spec_helper'
4
-
5
- require 'cucumber/formatter/junit'
6
- require 'nokogiri'
7
-
8
- module Cucumber
9
- module Formatter
10
- describe Junit do
11
- extend SpecHelperDsl
12
- include SpecHelper
13
-
14
- class TestDoubleJunitFormatter < Junit
15
- attr_reader :written_files
16
-
17
- def write_file(feature_filename, data)
18
- @written_files ||= {}
19
- @written_files[feature_filename] = data
20
- end
21
- end
22
-
23
- context 'With no options' do
24
- before(:each) do
25
- allow(File).to receive(:directory?) { true }
26
- @formatter = TestDoubleJunitFormatter.new(actual_runtime.configuration.with_options(out_stream: ''))
27
- end
28
-
29
- after(:each) do
30
- $stdout = STDOUT
31
- end
32
-
33
- describe 'is able to strip control chars from cdata' do
34
- before(:each) do
35
- run_defined_feature
36
- @doc = Nokogiri.XML(@formatter.written_files.values.first)
37
- end
38
- define_feature "
39
- Feature: One passing scenario, one failing scenario
40
-
41
- Scenario: Passing
42
- Given a passing ctrl scenario
43
- "
44
- class Junit
45
- def before_step(step)
46
- return unless step.text.match('a passing ctrl scenario')
47
- Interceptor::Pipe.unwrap! :stdout
48
- @fake_io = $stdout = StringIO.new
49
- $stdout.sync = true
50
- @interceptedout = Interceptor::Pipe.wrap(:stdout)
51
- end
52
-
53
- def after_step(step)
54
- return unless step.text.match('a passing ctrl scenario')
55
- @interceptedout.write("boo\b\cx\e\a\f boo ")
56
- $stdout = STDOUT
57
- @fake_io.close
58
- end
59
- end
60
-
61
- it { expect(@doc.xpath('//testsuite/testcase/system-out').first.content).to match(/\s+boo boo\s+/) }
62
- end
63
-
64
- describe 'a feature with no name' do
65
- define_feature <<-FEATURE
66
- Feature:
67
- Scenario: Passing
68
- Given a passing scenario
69
- FEATURE
70
-
71
- it 'raises an exception' do
72
- expect(-> {
73
- run_defined_feature
74
- }).to raise_error(Junit::UnNamedFeatureError)
75
- end
76
- end
77
-
78
- describe 'given a single feature' do
79
- before(:each) do
80
- run_defined_feature
81
- @doc = Nokogiri.XML(@formatter.written_files.values.first)
82
- end
83
-
84
- describe 'with a single scenario' do
85
- define_feature <<-FEATURE
86
- Feature: One passing scenario, one failing scenario
87
-
88
- Scenario: Passing
89
- Given a passing scenario
90
- FEATURE
91
-
92
- it { expect(@doc.to_s).to match(/One passing scenario, one failing scenario/) }
93
-
94
- it 'has not a root system-out node' do
95
- expect(@doc.xpath('//testsuite/system-out').size).to eq 0
96
- end
97
-
98
- it 'has not a root system-err node' do
99
- expect(@doc.xpath('//testsuite/system-err').size).to eq 0
100
- end
101
-
102
- it 'has a system-out node under <testcase/>' do
103
- expect(@doc.xpath('//testcase/system-out').size).to eq 1
104
- end
105
-
106
- it 'has a system-err node under <testcase/>' do
107
- expect(@doc.xpath('//testcase/system-err').size).to eq 1
108
- end
109
- end
110
-
111
- describe 'with a scenario in a subdirectory' do
112
- define_feature %{
113
- Feature: One passing scenario, one failing scenario
114
-
115
- Scenario: Passing
116
- Given a passing scenario
117
- }, File.join('features', 'some', 'path', 'spec.feature')
118
-
119
- it 'writes the filename with absolute path' do
120
- expect(@formatter.written_files.keys.first).to eq File.absolute_path('TEST-features-some-path-spec.xml')
121
- end
122
- end
123
-
124
- describe 'with a scenario outline table' do
125
- define_steps do
126
- Given(/.*/) { }
127
- end
128
-
129
- define_feature <<-FEATURE
130
- Feature: Eat things when hungry
131
-
132
- Scenario Outline: Eat things
133
- Given <Things>
134
- And stuff:
135
- | foo |
136
- | bar |
137
-
138
- Examples: Good
139
- | Things |
140
- | Cucumber |
141
- | Whisky |
142
- Examples: Evil
143
- | Things |
144
- | Big Mac |
145
- FEATURE
146
-
147
- it { expect(@doc.to_s).to match(/Eat things when hungry/) }
148
- it { expect(@doc.to_s).to match(/Cucumber/) }
149
- it { expect(@doc.to_s).to match(/Whisky/) }
150
- it { expect(@doc.to_s).to match(/Big Mac/) }
151
- it { expect(@doc.to_s).not_to match(/Things/) }
152
- it { expect(@doc.to_s).not_to match(/Good|Evil/) }
153
- it { expect(@doc.to_s).not_to match(/type="skipped"/)}
154
- end
155
-
156
- describe 'scenario with skipped test in junit report' do
157
- define_feature <<-FEATURE
158
- Feature: junit report with skipped test
159
-
160
- Scenario Outline: skip a test and junit report of the same
161
- Given a <skip> scenario
162
-
163
- Examples:
164
- | skip |
165
- | undefined |
166
- | still undefined |
167
- FEATURE
168
-
169
- it { expect(@doc.to_s).to match(/skipped="2"/)}
170
- end
171
-
172
- describe 'with a regular data table scenario' do
173
- define_steps do
174
- Given(/the following items on a shortlist/) { |table| }
175
- When(/I go.*/) { }
176
- Then(/I should have visited at least/) { |table| }
177
- end
178
-
179
- define_feature <<-FEATURE
180
- Feature: Shortlist
181
-
182
- Scenario: Procure items
183
- Given the following items on a shortlist:
184
- | item |
185
- | milk |
186
- | cookies |
187
- When I get some..
188
- Then I'll eat 'em
189
-
190
- FEATURE
191
- # these type of tables shouldn't crash (or generate test cases)
192
- it { expect(@doc.to_s).not_to match(/milk/) }
193
- it { expect(@doc.to_s).not_to match(/cookies/) }
194
- end
195
- end
196
- end
197
-
198
- context 'In --expand mode' do
199
- let(:runtime) { Runtime.new({:expand => true}) }
200
- before(:each) do
201
- allow(File).to receive(:directory?) { true }
202
- @formatter = TestDoubleJunitFormatter.new(actual_runtime.configuration.with_options(out_stream: '', :expand => true))
203
- end
204
-
205
- after(:each) do
206
- $stdout = STDOUT
207
- end
208
-
209
- describe 'given a single feature' do
210
- before(:each) do
211
- run_defined_feature
212
- @doc = Nokogiri.XML(@formatter.written_files.values.first)
213
- end
214
-
215
- describe 'with a scenario outline table' do
216
- define_steps do
217
- Given(/.*/) { }
218
- end
219
-
220
- define_feature <<-FEATURE
221
- Feature: Eat things when hungry
222
-
223
- Scenario Outline: Eat things
224
- Given <Things>
225
- And stuff:
226
- | foo |
227
- | bar |
228
-
229
- Examples: Good
230
- | Things |
231
- | Cucumber |
232
- | Whisky |
233
- Examples: Evil
234
- | Things |
235
- | Big Mac |
236
- FEATURE
237
-
238
- it { expect(@doc.to_s).to match(/Eat things when hungry/) }
239
- it { expect(@doc.to_s).to match(/Cucumber/) }
240
- it { expect(@doc.to_s).to match(/Whisky/) }
241
- it { expect(@doc.to_s).to match(/Big Mac/) }
242
- it { expect(@doc.to_s).not_to match(/Things/) }
243
- it { expect(@doc.to_s).not_to match(/Good|Evil/) }
244
- it { expect(@doc.to_s).not_to match(/type="skipped"/)}
245
- end
246
- end
247
-
248
- end
249
- end
250
- end
251
- end
@@ -1,2175 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'cucumber/formatter/legacy_api/adapter'
3
- require 'cucumber/core'
4
- require 'cucumber/core/gherkin/writer'
5
- require 'cucumber/runtime/step_hooks'
6
- require 'cucumber/runtime/before_hooks'
7
- require 'cucumber/runtime/after_hooks'
8
- require 'cucumber/filters'
9
- require 'spec_helper'
10
-
11
- module Cucumber
12
- module Formatter::LegacyApi
13
- describe Adapter do
14
- include Core::Gherkin::Writer
15
- include Core
16
-
17
- let!(:report) { Adapter.new(formatter, runtime.results, runtime.configuration) }
18
- let(:formatter) { double('formatter').as_null_object }
19
- let(:runtime) { Runtime.new }
20
- let(:events) { runtime.configuration.event_bus }
21
- let(:step_match_search) { SimpleStepDefinitionSearch.new }
22
-
23
- Failure = Class.new(StandardError)
24
-
25
- class SimpleStepMatch
26
- def initialize(&block)
27
- @block = block
28
- end
29
-
30
- def activate(test_step)
31
- test_step.with_action &@block
32
- end
33
- end
34
-
35
- class SimpleStepDefinitionSearch
36
- def call(name)
37
- if name =~ /pass/
38
- return [SimpleStepMatch.new {}]
39
- end
40
-
41
- if name =~ /fail/
42
- return [SimpleStepMatch.new { raise Failure }]
43
- end
44
-
45
- []
46
- end
47
- end
48
-
49
- class HookWrapper
50
- def initialize(proc)
51
- @proc = proc
52
- end
53
-
54
- def source_location
55
- @proc.source_location
56
- end
57
-
58
- def location
59
- source_location
60
- end
61
-
62
- def invoke(_pseudo_method, _arguments, &_block)
63
- @proc.call
64
- end
65
- end
66
-
67
- class AddBeforeAndAfterHooks < Core::Filter.new
68
- def test_case(test_case)
69
- steps = before_hooks(test_case.source) +
70
- test_case.test_steps +
71
- after_hooks(test_case.source)
72
- test_case.with_steps(steps).describe_to receiver
73
- end
74
-
75
- private
76
-
77
- def before_hooks(source)
78
- # The adapter is built on the assumption that each test case will have at least one step. This is annoying
79
- # for tests, but a safe assumption for production use as we always add one hook to initialize the world.
80
- hook = proc {}
81
- [ Hooks.before_hook(source, hook.source_location, &hook) ]
82
- end
83
-
84
- def after_hooks(source)
85
- # We add an after hook to make sure the adapter can cope with it
86
- hook = proc {}
87
- [ Hooks.after_hook(source, hook.source_location, &hook) ]
88
- end
89
- end
90
-
91
- context 'message order' do
92
- let(:formatter) { MessageSpy.new }
93
-
94
- it 'two features' do
95
- gherkin_docs = [
96
- gherkin do
97
- feature do
98
- scenario do
99
- step 'passing'
100
- end
101
- end
102
- end,
103
- gherkin do
104
- feature do
105
- scenario do
106
- step 'passing'
107
- end
108
- end
109
- end
110
- ]
111
- runner = Core::Test::Runner.new(events)
112
- compile gherkin_docs, runner, default_filters
113
- events.test_run_finished
114
- # rubocop:disable AlignArray
115
- expect( formatter.legacy_messages ).to eq [
116
- :before_features,
117
- :before_feature,
118
- :before_tags,
119
- :after_tags,
120
- :feature_name,
121
- :before_feature_element,
122
- :before_tags,
123
- :after_tags,
124
- :scenario_name,
125
- :before_steps,
126
- :before_step,
127
- :before_step_result,
128
- :step_name,
129
- :after_step_result,
130
- :after_step,
131
- :after_steps,
132
- :after_feature_element,
133
- :after_feature,
134
- :before_feature,
135
- :before_tags,
136
- :after_tags,
137
- :feature_name,
138
- :before_feature_element,
139
- :before_tags,
140
- :after_tags,
141
- :scenario_name,
142
- :before_steps,
143
- :before_step,
144
- :before_step_result,
145
- :step_name,
146
- :after_step_result,
147
- :after_step,
148
- :after_steps,
149
- :after_feature_element,
150
- :after_feature,
151
- :after_features
152
- ]
153
- # rubocop:enable AlignArray
154
- end
155
-
156
- it 'a scenario with one step' do
157
- execute_gherkin do
158
- feature do
159
- scenario do
160
- step 'passing'
161
- end
162
- end
163
- end
164
-
165
- # rubocop:disable AlignArray
166
- expect( formatter.legacy_messages ).to eq [
167
- :before_features,
168
- :before_feature,
169
- :before_tags,
170
- :after_tags,
171
- :feature_name,
172
- :before_feature_element,
173
- :before_tags,
174
- :after_tags,
175
- :scenario_name,
176
- :before_steps,
177
- :before_step,
178
- :before_step_result,
179
- :step_name,
180
- :after_step_result,
181
- :after_step,
182
- :after_steps,
183
- :after_feature_element,
184
- :after_feature,
185
- :after_features
186
- ]
187
- # rubocop:enable AlignArray
188
- end
189
-
190
- it 'a scenario with two steps, one of them failing' do
191
- execute_gherkin do
192
- feature do
193
- scenario do
194
- step 'passing'
195
- step 'failing'
196
- end
197
- end
198
- end
199
- expect( formatter.legacy_messages ).to eq [
200
- :before_features,
201
- :before_feature,
202
- :before_tags,
203
- :after_tags,
204
- :feature_name,
205
- :before_feature_element,
206
- :before_tags,
207
- :after_tags,
208
- :scenario_name,
209
- :before_steps,
210
- :before_step,
211
- :before_step_result,
212
- :step_name,
213
- :after_step_result,
214
- :after_step,
215
- :before_step,
216
- :before_step_result,
217
- :step_name,
218
- :exception,
219
- :after_step_result,
220
- :after_step,
221
- :after_steps,
222
- :after_feature_element,
223
- :after_feature,
224
- :after_features
225
- ]
226
- end
227
-
228
- it 'a feature with two scenarios' do
229
- execute_gherkin do
230
- feature do
231
- scenario do
232
- step 'passing'
233
- end
234
- scenario do
235
- step 'passing'
236
- end
237
- end
238
- end
239
-
240
- # rubocop:disable AlignArray
241
- expect( formatter.legacy_messages ).to eq [
242
- :before_features,
243
- :before_feature,
244
- :before_tags,
245
- :after_tags,
246
- :feature_name,
247
- :before_feature_element,
248
- :before_tags,
249
- :after_tags,
250
- :scenario_name,
251
- :before_steps,
252
- :before_step,
253
- :before_step_result,
254
- :step_name,
255
- :after_step_result,
256
- :after_step,
257
- :after_steps,
258
- :after_feature_element,
259
- :before_feature_element,
260
- :before_tags,
261
- :after_tags,
262
- :scenario_name,
263
- :before_steps,
264
- :before_step,
265
- :before_step_result,
266
- :step_name,
267
- :after_step_result,
268
- :after_step,
269
- :after_steps,
270
- :after_feature_element,
271
- :after_feature,
272
- :after_features
273
- ]
274
- # rubocop:enable AlignArray
275
- end
276
-
277
- it 'a feature with a background and an empty scenario' do
278
- execute_gherkin do
279
- feature do
280
- background do
281
- step 'passing'
282
- end
283
- scenario
284
- end
285
- end
286
-
287
- # rubocop:disable AlignArray
288
- expect( formatter.legacy_messages ).to eq [
289
- :before_features,
290
- :before_feature,
291
- :before_tags,
292
- :after_tags,
293
- :feature_name,
294
- :before_background,
295
- :background_name,
296
- :before_steps,
297
- :before_step,
298
- :before_step_result,
299
- :step_name,
300
- :after_step_result,
301
- :after_step,
302
- :after_steps,
303
- :after_background,
304
- :before_feature_element,
305
- :before_tags,
306
- :after_tags,
307
- :scenario_name,
308
- :after_feature_element,
309
- :after_feature,
310
- :after_features
311
- ]
312
- # rubocop:enable AlignArray
313
- end
314
-
315
- it 'a feature with a background and two scenarios' do
316
- execute_gherkin do
317
- feature do
318
- background do
319
- step 'passing'
320
- end
321
- scenario do
322
- step 'passing'
323
- end
324
- scenario do
325
- step 'passing'
326
- end
327
- end
328
- end
329
-
330
- # rubocop:disable AlignArray
331
- expect( formatter.legacy_messages ).to eq [
332
- :before_features,
333
- :before_feature,
334
- :before_tags,
335
- :after_tags,
336
- :feature_name,
337
- :before_background,
338
- :background_name,
339
- :before_steps,
340
- :before_step,
341
- :before_step_result,
342
- :step_name,
343
- :after_step_result,
344
- :after_step,
345
- :after_steps,
346
- :after_background,
347
- :before_feature_element,
348
- :before_tags,
349
- :after_tags,
350
- :scenario_name,
351
- :before_steps,
352
- :before_step,
353
- :before_step_result,
354
- :step_name,
355
- :after_step_result,
356
- :after_step,
357
- :after_steps,
358
- :after_feature_element,
359
- :before_feature_element,
360
- :before_tags,
361
- :after_tags,
362
- :scenario_name,
363
- :before_steps,
364
- :before_step,
365
- :before_step_result,
366
- :step_name,
367
- :after_step_result,
368
- :after_step,
369
- :after_steps,
370
- :after_feature_element,
371
- :after_feature,
372
- :after_features
373
- ]
374
- # rubocop:enable AlignArray
375
- end
376
-
377
- it 'a feature with a background and one scenario and one scenario outline' do
378
- execute_gherkin do
379
- feature do
380
- background do
381
- step 'passing'
382
- end
383
- scenario do
384
- step 'passing'
385
- end
386
- scenario_outline do
387
- step '<result>ing'
388
- examples do
389
- row 'result'
390
- row 'pass'
391
- end
392
- end
393
- end
394
- end
395
-
396
- # rubocop:disable AlignArray
397
- expect( formatter.legacy_messages ).to eq [
398
- :before_features,
399
- :before_feature,
400
- :before_tags,
401
- :after_tags,
402
- :feature_name,
403
- :before_background,
404
- :background_name,
405
- :before_steps,
406
- :before_step,
407
- :before_step_result,
408
- :step_name,
409
- :after_step_result,
410
- :after_step,
411
- :after_steps,
412
- :after_background,
413
- :before_feature_element,
414
- :before_tags,
415
- :after_tags,
416
- :scenario_name,
417
- :before_steps,
418
- :before_step,
419
- :before_step_result,
420
- :step_name,
421
- :after_step_result,
422
- :after_step,
423
- :after_steps,
424
- :after_feature_element,
425
- :before_feature_element,
426
- :before_tags,
427
- :after_tags,
428
- :scenario_name,
429
- :before_steps,
430
- :before_step,
431
- :before_step_result,
432
- :step_name,
433
- :after_step_result,
434
- :after_step,
435
- :after_steps,
436
- :before_examples_array,
437
- :before_examples,
438
- :before_tags,
439
- :after_tags,
440
- :examples_name,
441
- :before_outline_table,
442
- :before_table_row,
443
- :before_table_cell,
444
- :table_cell_value,
445
- :after_table_cell,
446
- :after_table_row,
447
- :before_table_row,
448
- :before_table_cell,
449
- :table_cell_value,
450
- :after_table_cell,
451
- :after_table_row,
452
- :after_outline_table,
453
- :after_examples,
454
- :after_examples_array,
455
- :after_feature_element,
456
- :after_feature,
457
- :after_features
458
- ]
459
- # rubocop:enable AlignArray
460
- end
461
-
462
- it 'a feature with a background and one scenario outline and one scenario' do
463
- execute_gherkin do
464
- feature do
465
- background do
466
- step 'passing'
467
- end
468
- scenario_outline do
469
- step '<result>ing'
470
- examples do
471
- row 'result'
472
- row 'pass'
473
- end
474
- end
475
- scenario do
476
- step 'passing'
477
- end
478
- end
479
- end
480
-
481
- # rubocop:disable AlignArray
482
- expect( formatter.legacy_messages ).to eq [
483
- :before_features,
484
- :before_feature,
485
- :before_tags,
486
- :after_tags,
487
- :feature_name,
488
- :before_background,
489
- :background_name,
490
- :before_steps,
491
- :before_step,
492
- :before_step_result,
493
- :step_name,
494
- :after_step_result,
495
- :after_step,
496
- :after_steps,
497
- :after_background,
498
- :before_feature_element,
499
- :before_tags,
500
- :after_tags,
501
- :scenario_name,
502
- :before_steps,
503
- :before_step,
504
- :before_step_result,
505
- :step_name,
506
- :after_step_result,
507
- :after_step,
508
- :after_steps,
509
- :before_examples_array,
510
- :before_examples,
511
- :before_tags,
512
- :after_tags,
513
- :examples_name,
514
- :before_outline_table,
515
- :before_table_row,
516
- :before_table_cell,
517
- :table_cell_value,
518
- :after_table_cell,
519
- :after_table_row,
520
- :before_table_row,
521
- :before_table_cell,
522
- :table_cell_value,
523
- :after_table_cell,
524
- :after_table_row,
525
- :after_outline_table,
526
- :after_examples,
527
- :after_examples_array,
528
- :after_feature_element,
529
- :before_feature_element,
530
- :before_tags,
531
- :after_tags,
532
- :scenario_name,
533
- :before_steps,
534
- :before_step,
535
- :before_step_result,
536
- :step_name,
537
- :after_step_result,
538
- :after_step,
539
- :after_steps,
540
- :after_feature_element,
541
- :after_feature,
542
- :after_features
543
- ]
544
- # rubocop:enable AlignArray
545
- end
546
-
547
- it 'a feature with a background and two scenario outlines' do
548
- execute_gherkin do
549
- feature do
550
- background do
551
- step 'passing'
552
- end
553
- scenario_outline do
554
- step '<result>ing'
555
- examples do
556
- row 'result'
557
- row 'pass'
558
- end
559
- end
560
- scenario_outline do
561
- step '<result>ing'
562
- examples do
563
- row 'result'
564
- row 'pass'
565
- end
566
- end
567
- end
568
- end
569
-
570
- # rubocop:disable AlignArray
571
- expect( formatter.legacy_messages ).to eq [
572
- :before_features,
573
- :before_feature,
574
- :before_tags,
575
- :after_tags,
576
- :feature_name,
577
- :before_background,
578
- :background_name,
579
- :before_steps,
580
- :before_step,
581
- :before_step_result,
582
- :step_name,
583
- :after_step_result,
584
- :after_step,
585
- :after_steps,
586
- :after_background,
587
- :before_feature_element,
588
- :before_tags,
589
- :after_tags,
590
- :scenario_name,
591
- :before_steps,
592
- :before_step,
593
- :before_step_result,
594
- :step_name,
595
- :after_step_result,
596
- :after_step,
597
- :after_steps,
598
- :before_examples_array,
599
- :before_examples,
600
- :before_tags,
601
- :after_tags,
602
- :examples_name,
603
- :before_outline_table,
604
- :before_table_row,
605
- :before_table_cell,
606
- :table_cell_value,
607
- :after_table_cell,
608
- :after_table_row,
609
- :before_table_row,
610
- :before_table_cell,
611
- :table_cell_value,
612
- :after_table_cell,
613
- :after_table_row,
614
- :after_outline_table,
615
- :after_examples,
616
- :after_examples_array,
617
- :after_feature_element,
618
- :before_feature_element,
619
- :before_tags,
620
- :after_tags,
621
- :scenario_name,
622
- :before_steps,
623
- :before_step,
624
- :before_step_result,
625
- :step_name,
626
- :after_step_result,
627
- :after_step,
628
- :after_steps,
629
- :before_examples_array,
630
- :before_examples,
631
- :before_tags,
632
- :after_tags,
633
- :examples_name,
634
- :before_outline_table,
635
- :before_table_row,
636
- :before_table_cell,
637
- :table_cell_value,
638
- :after_table_cell,
639
- :after_table_row,
640
- :before_table_row,
641
- :before_table_cell,
642
- :table_cell_value,
643
- :after_table_cell,
644
- :after_table_row,
645
- :after_outline_table,
646
- :after_examples,
647
- :after_examples_array,
648
- :after_feature_element,
649
- :after_feature,
650
- :after_features
651
- ]
652
- # rubocop:enable AlignArray
653
- end
654
-
655
- it 'a feature with a background and one scenario outline with two rows' do
656
- execute_gherkin do
657
- feature do
658
- background do
659
- step 'passing'
660
- end
661
- scenario_outline do
662
- step '<result>ing'
663
- examples do
664
- row 'result'
665
- row 'pass'
666
- row 'pass'
667
- end
668
- end
669
- end
670
- end
671
-
672
- # rubocop:disable AlignArray
673
- expect( formatter.legacy_messages ).to eq [
674
- :before_features,
675
- :before_feature,
676
- :before_tags,
677
- :after_tags,
678
- :feature_name,
679
- :before_background,
680
- :background_name,
681
- :before_steps,
682
- :before_step,
683
- :before_step_result,
684
- :step_name,
685
- :after_step_result,
686
- :after_step,
687
- :after_steps,
688
- :after_background,
689
- :before_feature_element,
690
- :before_tags,
691
- :after_tags,
692
- :scenario_name,
693
- :before_steps,
694
- :before_step,
695
- :before_step_result,
696
- :step_name,
697
- :after_step_result,
698
- :after_step,
699
- :after_steps,
700
- :before_examples_array,
701
- :before_examples,
702
- :before_tags,
703
- :after_tags,
704
- :examples_name,
705
- :before_outline_table,
706
- :before_table_row,
707
- :before_table_cell,
708
- :table_cell_value,
709
- :after_table_cell,
710
- :after_table_row,
711
- :before_table_row,
712
- :before_table_cell,
713
- :table_cell_value,
714
- :after_table_cell,
715
- :after_table_row,
716
- :before_table_row,
717
- :before_table_cell,
718
- :table_cell_value,
719
- :after_table_cell,
720
- :after_table_row,
721
- :after_outline_table,
722
- :after_examples,
723
- :after_examples_array,
724
- :after_feature_element,
725
- :after_feature,
726
- :after_features
727
- ]
728
- # rubocop:enable AlignArray
729
- end
730
-
731
- it 'a feature with a background and one scenario outline with two examples tables' do
732
- execute_gherkin do
733
- feature do
734
- background do
735
- step 'passing'
736
- end
737
- scenario_outline do
738
- step '<result>ing'
739
- examples do
740
- row 'result'
741
- row 'pass'
742
- end
743
- examples do
744
- row 'result'
745
- row 'pass'
746
- end
747
- end
748
- end
749
- end
750
-
751
- # rubocop:disable AlignArray
752
- expect( formatter.legacy_messages ).to eq [
753
- :before_features,
754
- :before_feature,
755
- :before_tags,
756
- :after_tags,
757
- :feature_name,
758
- :before_background,
759
- :background_name,
760
- :before_steps,
761
- :before_step,
762
- :before_step_result,
763
- :step_name,
764
- :after_step_result,
765
- :after_step,
766
- :after_steps,
767
- :after_background,
768
- :before_feature_element,
769
- :before_tags,
770
- :after_tags,
771
- :scenario_name,
772
- :before_steps,
773
- :before_step,
774
- :before_step_result,
775
- :step_name,
776
- :after_step_result,
777
- :after_step,
778
- :after_steps,
779
- :before_examples_array,
780
- :before_examples,
781
- :before_tags,
782
- :after_tags,
783
- :examples_name,
784
- :before_outline_table,
785
- :before_table_row,
786
- :before_table_cell,
787
- :table_cell_value,
788
- :after_table_cell,
789
- :after_table_row,
790
- :before_table_row,
791
- :before_table_cell,
792
- :table_cell_value,
793
- :after_table_cell,
794
- :after_table_row,
795
- :after_outline_table,
796
- :after_examples,
797
- :before_examples,
798
- :before_tags,
799
- :after_tags,
800
- :examples_name,
801
- :before_outline_table,
802
- :before_table_row,
803
- :before_table_cell,
804
- :table_cell_value,
805
- :after_table_cell,
806
- :after_table_row,
807
- :before_table_row,
808
- :before_table_cell,
809
- :table_cell_value,
810
- :after_table_cell,
811
- :after_table_row,
812
- :after_outline_table,
813
- :after_examples,
814
- :after_examples_array,
815
- :after_feature_element,
816
- :after_feature,
817
- :after_features
818
- ]
819
- # rubocop:enable AlignArray
820
- end
821
-
822
- it 'a feature with a background with two steps' do
823
- execute_gherkin do
824
- feature do
825
- background do
826
- step 'passing'
827
- step 'passing'
828
- end
829
- scenario do
830
- step 'passing'
831
- end
832
- end
833
- end
834
-
835
- # rubocop:disable AlignArray
836
- expect( formatter.legacy_messages ).to eq [
837
- :before_features,
838
- :before_feature,
839
- :before_tags,
840
- :after_tags,
841
- :feature_name,
842
- :before_background,
843
- :background_name,
844
- :before_steps,
845
- :before_step,
846
- :before_step_result,
847
- :step_name,
848
- :after_step_result,
849
- :after_step,
850
- :before_step,
851
- :before_step_result,
852
- :step_name,
853
- :after_step_result,
854
- :after_step,
855
- :after_steps,
856
- :after_background,
857
- :before_feature_element,
858
- :before_tags,
859
- :after_tags,
860
- :scenario_name,
861
- :before_steps,
862
- :before_step,
863
- :before_step_result,
864
- :step_name,
865
- :after_step_result,
866
- :after_step,
867
- :after_steps,
868
- :after_feature_element,
869
- :after_feature,
870
- :after_features
871
- ]
872
- # rubocop:enable AlignArray
873
- end
874
-
875
- it 'a feature with a background' do
876
- execute_gherkin do
877
- feature do
878
- background do
879
- step 'passing'
880
- end
881
- scenario do
882
- step 'passing'
883
- end
884
- end
885
- end
886
- expect( formatter.legacy_messages ).to eq [
887
- :before_features,
888
- :before_feature,
889
- :before_tags,
890
- :after_tags,
891
- :feature_name,
892
- :before_background,
893
- :background_name,
894
- :before_steps,
895
- :before_step,
896
- :before_step_result,
897
- :step_name,
898
- :after_step_result,
899
- :after_step,
900
- :after_steps,
901
- :after_background,
902
- :before_feature_element,
903
- :before_tags,
904
- :after_tags,
905
- :scenario_name,
906
- :before_steps,
907
- :before_step,
908
- :before_step_result,
909
- :step_name,
910
- :after_step_result,
911
- :after_step,
912
- :after_steps,
913
- :after_feature_element,
914
- :after_feature,
915
- :after_features
916
- ]
917
- end
918
-
919
- it 'scenario outline' do
920
- execute_gherkin do
921
- feature do
922
- scenario_outline do
923
- step '<result>ing'
924
- examples do
925
- row 'result'
926
- row 'pass'
927
- end
928
- end
929
- end
930
- end
931
-
932
- # rubocop:disable AlignArray
933
- expect( formatter.legacy_messages ).to eq [
934
- :before_features,
935
- :before_feature,
936
- :before_tags,
937
- :after_tags,
938
- :feature_name,
939
- :before_feature_element,
940
- :before_tags,
941
- :after_tags,
942
- :scenario_name,
943
- :before_steps,
944
- :before_step,
945
- :before_step_result,
946
- :step_name,
947
- :after_step_result,
948
- :after_step,
949
- :after_steps,
950
- :before_examples_array,
951
- :before_examples,
952
- :before_tags,
953
- :after_tags,
954
- :examples_name,
955
- :before_outline_table,
956
- :before_table_row,
957
- :before_table_cell,
958
- :table_cell_value,
959
- :after_table_cell,
960
- :after_table_row,
961
- :before_table_row,
962
- :before_table_cell,
963
- :table_cell_value,
964
- :after_table_cell,
965
- :after_table_row,
966
- :after_outline_table,
967
- :after_examples,
968
- :after_examples_array,
969
- :after_feature_element,
970
- :after_feature,
971
- :after_features
972
- ]
973
- # rubocop:enable AlignArray
974
- end
975
-
976
- it 'scenario outline after scenario' do
977
- execute_gherkin do
978
- feature do
979
- scenario do
980
- step 'passing'
981
- end
982
- scenario_outline do
983
- step '<result>ing'
984
- examples do
985
- row 'result'
986
- row 'pass'
987
- end
988
- end
989
- end
990
- end
991
-
992
- # rubocop:disable AlignArray
993
- expect( formatter.legacy_messages ).to eq [
994
- :before_features,
995
- :before_feature,
996
- :before_tags,
997
- :after_tags,
998
- :feature_name,
999
- :before_feature_element,
1000
- :before_tags,
1001
- :after_tags,
1002
- :scenario_name,
1003
- :before_steps,
1004
- :before_step,
1005
- :before_step_result,
1006
- :step_name,
1007
- :after_step_result,
1008
- :after_step,
1009
- :after_steps,
1010
- :after_feature_element,
1011
- :before_feature_element,
1012
- :before_tags,
1013
- :after_tags,
1014
- :scenario_name,
1015
- :before_steps,
1016
- :before_step,
1017
- :before_step_result,
1018
- :step_name,
1019
- :after_step_result,
1020
- :after_step,
1021
- :after_steps,
1022
- :before_examples_array,
1023
- :before_examples,
1024
- :before_tags,
1025
- :after_tags,
1026
- :examples_name,
1027
- :before_outline_table,
1028
- :before_table_row,
1029
- :before_table_cell,
1030
- :table_cell_value,
1031
- :after_table_cell,
1032
- :after_table_row,
1033
- :before_table_row,
1034
- :before_table_cell,
1035
- :table_cell_value,
1036
- :after_table_cell,
1037
- :after_table_row,
1038
- :after_outline_table,
1039
- :after_examples,
1040
- :after_examples_array,
1041
- :after_feature_element,
1042
- :after_feature,
1043
- :after_features
1044
- ]
1045
- # rubocop:enable AlignArray
1046
- end
1047
-
1048
- it 'scenario outline before scenario' do
1049
- execute_gherkin do
1050
- feature do
1051
- scenario_outline do
1052
- step '<result>ing'
1053
- examples do
1054
- row 'result'
1055
- row 'pass'
1056
- end
1057
- end
1058
- scenario do
1059
- step 'passing'
1060
- end
1061
- end
1062
- end
1063
-
1064
- # rubocop:disable AlignArray
1065
- expect( formatter.legacy_messages ).to eq [
1066
- :before_features,
1067
- :before_feature,
1068
- :before_tags,
1069
- :after_tags,
1070
- :feature_name,
1071
- :before_feature_element,
1072
- :before_tags,
1073
- :after_tags,
1074
- :scenario_name,
1075
- :before_steps,
1076
- :before_step,
1077
- :before_step_result,
1078
- :step_name,
1079
- :after_step_result,
1080
- :after_step,
1081
- :after_steps,
1082
- :before_examples_array,
1083
- :before_examples,
1084
- :before_tags,
1085
- :after_tags,
1086
- :examples_name,
1087
- :before_outline_table,
1088
- :before_table_row,
1089
- :before_table_cell,
1090
- :table_cell_value,
1091
- :after_table_cell,
1092
- :after_table_row,
1093
- :before_table_row,
1094
- :before_table_cell,
1095
- :table_cell_value,
1096
- :after_table_cell,
1097
- :after_table_row,
1098
- :after_outline_table,
1099
- :after_examples,
1100
- :after_examples_array,
1101
- :after_feature_element,
1102
- :before_feature_element,
1103
- :before_tags,
1104
- :after_tags,
1105
- :scenario_name,
1106
- :before_steps,
1107
- :before_step,
1108
- :before_step_result,
1109
- :step_name,
1110
- :after_step_result,
1111
- :after_step,
1112
- :after_steps,
1113
- :after_feature_element,
1114
- :after_feature,
1115
- :after_features
1116
- ]
1117
- # rubocop:enable AlignArray
1118
- end
1119
-
1120
- it 'scenario outline two rows' do
1121
- execute_gherkin do
1122
- feature do
1123
- scenario_outline do
1124
- step '<result>ing'
1125
- examples do
1126
- row 'result'
1127
- row 'pass'
1128
- row 'pass'
1129
- end
1130
- end
1131
- end
1132
- end
1133
-
1134
- # rubocop:disable AlignArray
1135
- expect( formatter.legacy_messages ).to eq [
1136
- :before_features,
1137
- :before_feature,
1138
- :before_tags,
1139
- :after_tags,
1140
- :feature_name,
1141
- :before_feature_element,
1142
- :before_tags,
1143
- :after_tags,
1144
- :scenario_name,
1145
- :before_steps,
1146
- :before_step,
1147
- :before_step_result,
1148
- :step_name,
1149
- :after_step_result,
1150
- :after_step,
1151
- :after_steps,
1152
- :before_examples_array,
1153
- :before_examples,
1154
- :before_tags,
1155
- :after_tags,
1156
- :examples_name,
1157
- :before_outline_table,
1158
- :before_table_row,
1159
- :before_table_cell,
1160
- :table_cell_value,
1161
- :after_table_cell,
1162
- :after_table_row,
1163
- :before_table_row,
1164
- :before_table_cell,
1165
- :table_cell_value,
1166
- :after_table_cell,
1167
- :after_table_row,
1168
- :before_table_row,
1169
- :before_table_cell,
1170
- :table_cell_value,
1171
- :after_table_cell,
1172
- :after_table_row,
1173
- :after_outline_table,
1174
- :after_examples,
1175
- :after_examples_array,
1176
- :after_feature_element,
1177
- :after_feature,
1178
- :after_features
1179
- ]
1180
- # rubocop:enable AlignArray
1181
- end
1182
-
1183
- it 'scenario outline two examples tables' do
1184
- execute_gherkin do
1185
- feature do
1186
- scenario_outline do
1187
- step '<result>ing'
1188
- examples do
1189
- row 'result'
1190
- row 'pass'
1191
- end
1192
- examples do
1193
- row 'result'
1194
- row 'pass'
1195
- end
1196
- end
1197
- end
1198
- end
1199
-
1200
- # rubocop:disable AlignArray
1201
- expect( formatter.legacy_messages ).to eq [
1202
- :before_features,
1203
- :before_feature,
1204
- :before_tags,
1205
- :after_tags,
1206
- :feature_name,
1207
- :before_feature_element,
1208
- :before_tags,
1209
- :after_tags,
1210
- :scenario_name,
1211
- :before_steps,
1212
- :before_step,
1213
- :before_step_result,
1214
- :step_name,
1215
- :after_step_result,
1216
- :after_step,
1217
- :after_steps,
1218
- :before_examples_array,
1219
- :before_examples,
1220
- :before_tags,
1221
- :after_tags,
1222
- :examples_name,
1223
- :before_outline_table,
1224
- :before_table_row,
1225
- :before_table_cell,
1226
- :table_cell_value,
1227
- :after_table_cell,
1228
- :after_table_row,
1229
- :before_table_row,
1230
- :before_table_cell,
1231
- :table_cell_value,
1232
- :after_table_cell,
1233
- :after_table_row,
1234
- :after_outline_table,
1235
- :after_examples,
1236
- :before_examples,
1237
- :before_tags,
1238
- :after_tags,
1239
- :examples_name,
1240
- :before_outline_table,
1241
- :before_table_row,
1242
- :before_table_cell,
1243
- :table_cell_value,
1244
- :after_table_cell,
1245
- :after_table_row,
1246
- :before_table_row,
1247
- :before_table_cell,
1248
- :table_cell_value,
1249
- :after_table_cell,
1250
- :after_table_row,
1251
- :after_outline_table,
1252
- :after_examples,
1253
- :after_examples_array,
1254
- :after_feature_element,
1255
- :after_feature,
1256
- :after_features
1257
- ]
1258
- # rubocop:enable AlignArray
1259
- end
1260
-
1261
- it 'two scenario outline' do
1262
- execute_gherkin do
1263
- feature do
1264
- scenario_outline do
1265
- step '<result>ing'
1266
- examples do
1267
- row 'result'
1268
- row 'pass'
1269
- end
1270
- end
1271
- scenario_outline do
1272
- step '<result>ing'
1273
- examples do
1274
- row 'result'
1275
- row 'pass'
1276
- end
1277
- end
1278
- end
1279
- end
1280
-
1281
- # rubocop:disable AlignArray
1282
- expect( formatter.legacy_messages ).to eq [
1283
- :before_features,
1284
- :before_feature,
1285
- :before_tags,
1286
- :after_tags,
1287
- :feature_name,
1288
- :before_feature_element,
1289
- :before_tags,
1290
- :after_tags,
1291
- :scenario_name,
1292
- :before_steps,
1293
- :before_step,
1294
- :before_step_result,
1295
- :step_name,
1296
- :after_step_result,
1297
- :after_step,
1298
- :after_steps,
1299
- :before_examples_array,
1300
- :before_examples,
1301
- :before_tags,
1302
- :after_tags,
1303
- :examples_name,
1304
- :before_outline_table,
1305
- :before_table_row,
1306
- :before_table_cell,
1307
- :table_cell_value,
1308
- :after_table_cell,
1309
- :after_table_row,
1310
- :before_table_row,
1311
- :before_table_cell,
1312
- :table_cell_value,
1313
- :after_table_cell,
1314
- :after_table_row,
1315
- :after_outline_table,
1316
- :after_examples,
1317
- :after_examples_array,
1318
- :after_feature_element,
1319
- :before_feature_element,
1320
- :before_tags,
1321
- :after_tags,
1322
- :scenario_name,
1323
- :before_steps,
1324
- :before_step,
1325
- :before_step_result,
1326
- :step_name,
1327
- :after_step_result,
1328
- :after_step,
1329
- :after_steps,
1330
- :before_examples_array,
1331
- :before_examples,
1332
- :before_tags,
1333
- :after_tags,
1334
- :examples_name,
1335
- :before_outline_table,
1336
- :before_table_row,
1337
- :before_table_cell,
1338
- :table_cell_value,
1339
- :after_table_cell,
1340
- :after_table_row,
1341
- :before_table_row,
1342
- :before_table_cell,
1343
- :table_cell_value,
1344
- :after_table_cell,
1345
- :after_table_row,
1346
- :after_outline_table,
1347
- :after_examples,
1348
- :after_examples_array,
1349
- :after_feature_element,
1350
- :after_feature,
1351
- :after_features
1352
- ]
1353
- # rubocop:enable AlignArray
1354
- end
1355
-
1356
- it 'failing scenario outline' do
1357
- execute_gherkin do
1358
- feature do
1359
- scenario_outline do
1360
- step '<result>ing'
1361
- examples do
1362
- row 'result'
1363
- row 'fail'
1364
- end
1365
- end
1366
- end
1367
- end
1368
-
1369
- # rubocop:disable AlignArray
1370
- expect( formatter.legacy_messages ).to eq [
1371
- :before_features,
1372
- :before_feature,
1373
- :before_tags,
1374
- :after_tags,
1375
- :feature_name,
1376
- :before_feature_element,
1377
- :before_tags,
1378
- :after_tags,
1379
- :scenario_name,
1380
- :before_steps,
1381
- :before_step,
1382
- :before_step_result,
1383
- :step_name,
1384
- :after_step_result,
1385
- :after_step,
1386
- :after_steps,
1387
- :before_examples_array,
1388
- :before_examples,
1389
- :before_tags,
1390
- :after_tags,
1391
- :examples_name,
1392
- :before_outline_table,
1393
- :before_table_row,
1394
- :before_table_cell,
1395
- :table_cell_value,
1396
- :after_table_cell,
1397
- :after_table_row,
1398
- :before_table_row,
1399
- :before_table_cell,
1400
- :table_cell_value,
1401
- :after_table_cell,
1402
- :after_table_row,
1403
- :after_outline_table,
1404
- :after_examples,
1405
- :after_examples_array,
1406
- :after_feature_element,
1407
- :after_feature,
1408
- :after_features
1409
- ]
1410
- # rubocop:enable AlignArray
1411
- end
1412
-
1413
- it 'a feature with a failing background and two scenarios' do
1414
- execute_gherkin do
1415
- feature do
1416
- background do
1417
- step 'failing'
1418
- end
1419
- scenario do
1420
- step 'passing'
1421
- end
1422
- scenario do
1423
- step 'passing'
1424
- end
1425
- end
1426
- end
1427
-
1428
- # rubocop:disable AlignArray
1429
- expect( formatter.legacy_messages ).to eq [
1430
- :before_features,
1431
- :before_feature,
1432
- :before_tags,
1433
- :after_tags,
1434
- :feature_name,
1435
- :before_background,
1436
- :background_name,
1437
- :before_steps,
1438
- :before_step,
1439
- :before_step_result,
1440
- :step_name,
1441
- :exception,
1442
- :after_step_result,
1443
- :after_step,
1444
- :after_steps,
1445
- :after_background,
1446
- :before_feature_element,
1447
- :before_tags,
1448
- :after_tags,
1449
- :scenario_name,
1450
- :before_steps,
1451
- :before_step,
1452
- :before_step_result,
1453
- :step_name,
1454
- :after_step_result,
1455
- :after_step,
1456
- :after_steps,
1457
- :after_feature_element,
1458
- :before_feature_element,
1459
- :before_tags,
1460
- :after_tags,
1461
- :scenario_name,
1462
- :before_steps,
1463
- :before_step,
1464
- :before_step_result,
1465
- :step_name,
1466
- :after_step_result,
1467
- :after_step,
1468
- :after_steps,
1469
- :after_feature_element,
1470
- :after_feature,
1471
- :after_features
1472
- ]
1473
- # rubocop:enable AlignArray
1474
- end
1475
-
1476
- context 'in expand mode' do
1477
- let(:runtime) { Runtime.new expand: true }
1478
- let(:formatter) { MessageSpy.new }
1479
-
1480
- it 'scenario outline two rows' do
1481
- execute_gherkin do
1482
- feature do
1483
- scenario_outline do
1484
- step '<result>ing'
1485
- examples do
1486
- row 'result'
1487
- row 'pass'
1488
- row 'pass'
1489
- end
1490
- end
1491
- end
1492
- end
1493
-
1494
- # rubocop:disable AlignArray
1495
- expect( formatter.legacy_messages ).to eq [
1496
- :before_features,
1497
- :before_feature,
1498
- :before_tags,
1499
- :after_tags,
1500
- :feature_name,
1501
- :before_feature_element,
1502
- :before_tags,
1503
- :after_tags,
1504
- :scenario_name,
1505
- :before_steps,
1506
- :before_step,
1507
- :before_step_result,
1508
- :step_name,
1509
- :after_step_result,
1510
- :after_step,
1511
- :after_steps,
1512
- :before_examples_array,
1513
- :before_examples,
1514
- :before_tags,
1515
- :after_tags,
1516
- :examples_name,
1517
- :before_outline_table,
1518
- :scenario_name,
1519
- :before_step,
1520
- :before_step_result,
1521
- :step_name,
1522
- :after_step_result,
1523
- :after_step,
1524
- :scenario_name,
1525
- :before_step,
1526
- :before_step_result,
1527
- :step_name,
1528
- :after_step_result,
1529
- :after_step,
1530
- :after_outline_table,
1531
- :after_examples,
1532
- :after_examples_array,
1533
- :after_feature_element,
1534
- :after_feature,
1535
- :after_features
1536
- ]
1537
- # rubocop:enable AlignArray
1538
- end
1539
- end
1540
-
1541
- context 'with exception in after step hook' do
1542
-
1543
- class FailingAfterStepHook
1544
- def find_after_step_hooks(_test_case)
1545
- failing_hook = HookWrapper.new(proc { raise Failure })
1546
- Runtime::StepHooks.new [failing_hook]
1547
- end
1548
- end
1549
-
1550
- it 'prints the exception within the step' do
1551
- filters = [
1552
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
1553
- Filters::ApplyAfterStepHooks.new(FailingAfterStepHook.new),
1554
- AddBeforeAndAfterHooks.new
1555
- ]
1556
- execute_gherkin(filters) do
1557
- feature do
1558
- scenario do
1559
- step 'passing'
1560
- end
1561
- end
1562
- end
1563
-
1564
- # rubocop:disable AlignArray
1565
- expect( formatter.legacy_messages ).to eq([
1566
- :before_features,
1567
- :before_feature,
1568
- :before_tags,
1569
- :after_tags,
1570
- :feature_name,
1571
- :before_feature_element,
1572
- :before_tags,
1573
- :after_tags,
1574
- :scenario_name,
1575
- :before_steps,
1576
- :before_step,
1577
- :before_step_result,
1578
- :step_name,
1579
- :after_step_result,
1580
- :after_step,
1581
- :exception,
1582
- :after_steps,
1583
- :after_feature_element,
1584
- :after_feature,
1585
- :after_features
1586
- ])
1587
- # rubocop:enable AlignArray
1588
- end
1589
- end
1590
-
1591
- context 'with exception in a single before hook' do
1592
- class FailingBeforeHook
1593
- def apply_before_hooks(test_case)
1594
- failing_hook = HookWrapper.new(proc { raise Failure })
1595
- Runtime::BeforeHooks.new([failing_hook], RunningTestCase.new(test_case)).apply_to(test_case)
1596
- end
1597
- end
1598
-
1599
- it 'prints the exception after the scenario name' do
1600
- filters = [
1601
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
1602
- Filters::ApplyBeforeHooks.new(FailingBeforeHook.new),
1603
- AddBeforeAndAfterHooks.new
1604
- ]
1605
- execute_gherkin(filters) do
1606
- feature do
1607
- scenario do
1608
- step 'passing'
1609
- end
1610
- end
1611
- end
1612
-
1613
- # rubocop:disable AlignArray
1614
- expect( formatter.legacy_messages ).to eq([
1615
- :before_features,
1616
- :before_feature,
1617
- :before_tags,
1618
- :after_tags,
1619
- :feature_name,
1620
- :before_feature_element,
1621
- :before_tags,
1622
- :after_tags,
1623
- :scenario_name,
1624
- :exception,
1625
- :before_steps,
1626
- :before_step,
1627
- :before_step_result,
1628
- :step_name,
1629
- :after_step_result,
1630
- :after_step,
1631
- :after_steps,
1632
- :after_feature_element,
1633
- :after_feature,
1634
- :after_features
1635
- ])
1636
- # rubocop:enable AlignArray
1637
- end
1638
-
1639
- it 'prints the exception after the background name' do
1640
- filters = [
1641
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
1642
- Filters::ApplyBeforeHooks.new(FailingBeforeHook.new),
1643
- AddBeforeAndAfterHooks.new
1644
- ]
1645
- execute_gherkin(filters) do
1646
- feature do
1647
- background do
1648
- step 'passing'
1649
- end
1650
- scenario do
1651
- step 'passing'
1652
- end
1653
- end
1654
- end
1655
-
1656
- # rubocop:disable AlignArray
1657
- expect( formatter.legacy_messages ).to eq([
1658
- :before_features,
1659
- :before_feature,
1660
- :before_tags,
1661
- :after_tags,
1662
- :feature_name,
1663
- :before_background,
1664
- :background_name,
1665
- :exception,
1666
- :before_steps,
1667
- :before_step,
1668
- :before_step_result,
1669
- :step_name,
1670
- :after_step_result,
1671
- :after_step,
1672
- :after_steps,
1673
- :after_background,
1674
- :before_feature_element,
1675
- :before_tags,
1676
- :after_tags,
1677
- :scenario_name,
1678
- :before_steps,
1679
- :before_step,
1680
- :before_step_result,
1681
- :step_name,
1682
- :after_step_result,
1683
- :after_step,
1684
- :after_steps,
1685
- :after_feature_element,
1686
- :after_feature,
1687
- :after_features
1688
- ])
1689
- # rubocop:enable AlignArray
1690
- end
1691
-
1692
-
1693
- it 'prints the exception before the examples table row' do
1694
- filters = [
1695
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
1696
- Filters::ApplyBeforeHooks.new(FailingBeforeHook.new),
1697
- AddBeforeAndAfterHooks.new
1698
- ]
1699
- execute_gherkin(filters) do
1700
- feature do
1701
- scenario_outline do
1702
- step '<status>ing'
1703
- examples do
1704
- row 'status'
1705
- row 'pass'
1706
- end
1707
- end
1708
- end
1709
- end
1710
-
1711
- # rubocop:disable AlignArray
1712
- expect( formatter.legacy_messages ).to eq([
1713
- :before_features,
1714
- :before_feature,
1715
- :before_tags,
1716
- :after_tags,
1717
- :feature_name,
1718
- :before_feature_element,
1719
- :before_tags,
1720
- :after_tags,
1721
- :scenario_name,
1722
- :before_steps,
1723
- :before_step,
1724
- :before_step_result,
1725
- :step_name,
1726
- :after_step_result,
1727
- :after_step,
1728
- :after_steps,
1729
- :before_examples_array,
1730
- :before_examples,
1731
- :before_tags,
1732
- :after_tags,
1733
- :examples_name,
1734
- :before_outline_table,
1735
- :before_table_row,
1736
- :before_table_cell,
1737
- :table_cell_value,
1738
- :after_table_cell,
1739
- :after_table_row,
1740
- :exception,
1741
- :before_table_row,
1742
- :before_table_cell,
1743
- :table_cell_value,
1744
- :after_table_cell,
1745
- :after_table_row,
1746
- :after_outline_table,
1747
- :after_examples,
1748
- :after_examples_array,
1749
- :after_feature_element,
1750
- :after_feature,
1751
- :after_features
1752
- ])
1753
- # rubocop:enable AlignArray
1754
- end
1755
- end
1756
-
1757
- context 'with exception in the first of several before hooks' do
1758
- # This proves that the second before hook's result doesn't overwrite
1759
- # the result of the first one.
1760
- class FailingAndPassingBeforeHooks
1761
- def apply_before_hooks(test_case)
1762
- failing_hook = HookWrapper.new(proc { raise Failure })
1763
- passing_hook = HookWrapper.new(proc {})
1764
- Runtime::BeforeHooks.new([failing_hook, passing_hook], RunningTestCase.new(test_case)).apply_to(test_case)
1765
- end
1766
- end
1767
-
1768
- it 'prints the exception after the scenario name' do
1769
- filters = [
1770
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
1771
- Filters::ApplyBeforeHooks.new(FailingAndPassingBeforeHooks.new),
1772
- AddBeforeAndAfterHooks.new
1773
- ]
1774
- execute_gherkin(filters) do
1775
- feature do
1776
- scenario do
1777
- step 'passing'
1778
- end
1779
- end
1780
- end
1781
-
1782
- # rubocop:disable AlignArray
1783
- expect( formatter.legacy_messages ).to eq([
1784
- :before_features,
1785
- :before_feature,
1786
- :before_tags,
1787
- :after_tags,
1788
- :feature_name,
1789
- :before_feature_element,
1790
- :before_tags,
1791
- :after_tags,
1792
- :scenario_name,
1793
- :exception,
1794
- :before_steps,
1795
- :before_step,
1796
- :before_step_result,
1797
- :step_name,
1798
- :after_step_result,
1799
- :after_step,
1800
- :after_steps,
1801
- :after_feature_element,
1802
- :after_feature,
1803
- :after_features
1804
- ])
1805
- # rubocop:enable AlignArray
1806
- end
1807
- end
1808
-
1809
- context 'with exception in after hooks' do
1810
-
1811
- class FailingAfterHook
1812
- def apply_after_hooks(test_case)
1813
- failing_hook = HookWrapper.new(proc { raise Failure })
1814
- Runtime::AfterHooks.new([failing_hook], RunningTestCase.new(test_case)).apply_to(test_case)
1815
- end
1816
- end
1817
-
1818
- it 'prints the exception after the steps' do
1819
- filters = [
1820
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
1821
- Filters::ApplyAfterHooks.new(FailingAfterHook.new),
1822
- AddBeforeAndAfterHooks.new
1823
- ]
1824
- execute_gherkin(filters) do
1825
- feature do
1826
- scenario do
1827
- step 'passing'
1828
- end
1829
- end
1830
- end
1831
-
1832
- # rubocop:disable AlignArray
1833
- expect( formatter.legacy_messages ).to eq([
1834
- :before_features,
1835
- :before_feature,
1836
- :before_tags,
1837
- :after_tags,
1838
- :feature_name,
1839
- :before_feature_element,
1840
- :before_tags,
1841
- :after_tags,
1842
- :scenario_name,
1843
- :before_steps,
1844
- :before_step,
1845
- :before_step_result,
1846
- :step_name,
1847
- :after_step_result,
1848
- :after_step,
1849
- :after_steps,
1850
- :exception,
1851
- :after_feature_element,
1852
- :after_feature,
1853
- :after_features
1854
- ])
1855
- # rubocop:enable AlignArray
1856
- end
1857
-
1858
- it 'prints the exception after the examples table row' do
1859
- filters = [
1860
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
1861
- Filters::ApplyAfterHooks.new(FailingAfterHook.new),
1862
- AddBeforeAndAfterHooks.new
1863
- ]
1864
- execute_gherkin(filters) do
1865
- feature do
1866
- scenario_outline do
1867
- step '<status>ing'
1868
- examples do
1869
- row 'status'
1870
- row 'pass'
1871
- end
1872
- end
1873
- end
1874
- end
1875
-
1876
- # rubocop:disable AlignArray
1877
- expect( formatter.legacy_messages ).to eq([
1878
- :before_features,
1879
- :before_feature,
1880
- :before_tags,
1881
- :after_tags,
1882
- :feature_name,
1883
- :before_feature_element,
1884
- :before_tags,
1885
- :after_tags,
1886
- :scenario_name,
1887
- :before_steps,
1888
- :before_step,
1889
- :before_step_result,
1890
- :step_name,
1891
- :after_step_result,
1892
- :after_step,
1893
- :after_steps,
1894
- :before_examples_array,
1895
- :before_examples,
1896
- :before_tags,
1897
- :after_tags,
1898
- :examples_name,
1899
- :before_outline_table,
1900
- :before_table_row,
1901
- :before_table_cell,
1902
- :table_cell_value,
1903
- :after_table_cell,
1904
- :after_table_row,
1905
- :before_table_row,
1906
- :before_table_cell,
1907
- :table_cell_value,
1908
- :after_table_cell,
1909
- :after_table_row,
1910
- :exception,
1911
- :after_outline_table,
1912
- :after_examples,
1913
- :after_examples_array,
1914
- :after_feature_element,
1915
- :after_feature,
1916
- :after_features
1917
- ])
1918
- # rubocop:enable AlignArray
1919
- end
1920
- end
1921
-
1922
- context 'with exception in the first of several after hooks' do
1923
- class FailingThenPassingAfterHooks
1924
- def apply_after_hooks(test_case)
1925
- failing_hook = HookWrapper.new(proc { raise Failure })
1926
- passing_hook = HookWrapper.new(proc {})
1927
- Runtime::AfterHooks.new([failing_hook, passing_hook], RunningTestCase.new(test_case)).apply_to(test_case)
1928
- end
1929
- end
1930
-
1931
- it 'prints the exception after the steps' do
1932
- filters = [
1933
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
1934
- Filters::ApplyAfterHooks.new(FailingThenPassingAfterHooks.new),
1935
- AddBeforeAndAfterHooks.new
1936
- ]
1937
- execute_gherkin(filters) do
1938
- feature do
1939
- scenario do
1940
- step 'passing'
1941
- end
1942
- end
1943
- end
1944
-
1945
- # rubocop:disable AlignArray
1946
- expect( formatter.legacy_messages ).to eq([
1947
- :before_features,
1948
- :before_feature,
1949
- :before_tags,
1950
- :after_tags,
1951
- :feature_name,
1952
- :before_feature_element,
1953
- :before_tags,
1954
- :after_tags,
1955
- :scenario_name,
1956
- :before_steps,
1957
- :before_step,
1958
- :before_step_result,
1959
- :step_name,
1960
- :after_step_result,
1961
- :after_step,
1962
- :after_steps,
1963
- :exception,
1964
- :after_feature_element,
1965
- :after_feature,
1966
- :after_features
1967
- ])
1968
- # rubocop:enable AlignArray
1969
- end
1970
- end
1971
-
1972
- context 'with an exception in an around hook before the test case is run' do
1973
- class FailingAroundHookBeforeRunningTestCase
1974
- def find_around_hooks(test_case)
1975
- [
1976
- Hooks.around_hook(test_case.source) { raise Failure }
1977
- ]
1978
- end
1979
- end
1980
-
1981
- it 'prints the exception after the scenario name' do
1982
- filters = [
1983
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
1984
- Filters::ApplyAroundHooks.new(FailingAroundHookBeforeRunningTestCase.new),
1985
- AddBeforeAndAfterHooks.new
1986
- ]
1987
- execute_gherkin(filters) do
1988
- feature do
1989
- scenario do
1990
- step 'passing'
1991
- end
1992
- end
1993
- end
1994
-
1995
- # rubocop:disable AlignArray
1996
- expect( formatter.legacy_messages ).to eq([
1997
- :before_features,
1998
- :before_feature,
1999
- :before_tags,
2000
- :after_tags,
2001
- :feature_name,
2002
- :before_feature_element,
2003
- :before_tags,
2004
- :after_tags,
2005
- :scenario_name,
2006
- :exception,
2007
- :after_feature_element,
2008
- :after_feature,
2009
- :after_features
2010
- ])
2011
- # rubocop:enable AlignArray
2012
- end
2013
- end
2014
-
2015
- context 'with an exception in an around hook after the test case is run' do
2016
- class FailingAroundHookAfterRunningTestCase
2017
- def find_around_hooks(test_case)
2018
- [
2019
- Hooks.around_hook(test_case.source) { |run_test_case| run_test_case.call; raise Failure }
2020
- ]
2021
- end
2022
- end
2023
-
2024
- it 'prints the exception after the scenario name' do
2025
- filters = [
2026
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
2027
- Filters::ApplyAroundHooks.new(FailingAroundHookAfterRunningTestCase.new),
2028
- AddBeforeAndAfterHooks.new
2029
- ]
2030
- execute_gherkin(filters) do
2031
- feature do
2032
- scenario do
2033
- step
2034
- end
2035
- end
2036
- end
2037
- # rubocop:disable AlignArray
2038
- expect( formatter.legacy_messages ).to eq([
2039
- :before_features,
2040
- :before_feature,
2041
- :before_tags,
2042
- :after_tags,
2043
- :feature_name,
2044
- :before_feature_element,
2045
- :before_tags,
2046
- :after_tags,
2047
- :scenario_name,
2048
- :before_steps,
2049
- :before_step,
2050
- :before_step_result,
2051
- :step_name,
2052
- :after_step_result,
2053
- :after_step,
2054
- :exception,
2055
- :after_steps,
2056
- :after_feature_element,
2057
- :after_feature,
2058
- :after_features
2059
- ])
2060
- # rubocop:enable AlignArray
2061
- end
2062
- end
2063
- end
2064
-
2065
- describe 'before_step_result message' do
2066
- context 'when the step matches' do
2067
- it 'sends the step match to the formatter' do
2068
- expect(formatter).to receive(:before_step_result) do |_, step_match, *|
2069
- expect(step_match).to be_a SimpleStepMatch
2070
- end
2071
- execute_gherkin do
2072
- feature do
2073
- scenario do
2074
- step 'passing'
2075
- end
2076
- end
2077
- end
2078
- end
2079
- end
2080
-
2081
- context "when the step doesn't match" do
2082
- it 'sends a null object to the formatter' do
2083
- end
2084
- end
2085
- end
2086
-
2087
- it 'passes nil as the multiline arg when there is none' do
2088
- expect(formatter).to receive(:after_step_result) do |keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line|
2089
- expect(multiline_arg).to be_nil
2090
- end
2091
- execute_gherkin do
2092
- feature do
2093
- scenario do
2094
- step 'passing'
2095
- end
2096
- end
2097
- end
2098
- end
2099
-
2100
- context 'after_feature_element callback' do
2101
- it 'passes an object reflecting the status of the scenario' do
2102
- expect( formatter ).to receive(:after_feature_element).once do |scenario|
2103
- expect( scenario ).to be_failed
2104
- end
2105
- execute_gherkin do
2106
- feature do
2107
- scenario do
2108
- step 'failing'
2109
- step 'this will be skipped'
2110
- end
2111
- end
2112
- end
2113
- end
2114
- end
2115
-
2116
- context 'in strict mode' do
2117
- let(:runtime) { Runtime.new strict: Cucumber::Core::Test::Result::StrictConfiguration.new([:undefined]) }
2118
-
2119
- it 'passes an exception to the formatter for undefined steps' do
2120
- expect( formatter ).to receive(:exception) do |exception|
2121
- expect( exception.message ).to eq %{Undefined step: "this step is undefined"}
2122
- end
2123
- execute_gherkin do
2124
- feature do
2125
- scenario do
2126
- step 'this step is undefined'
2127
- end
2128
- end
2129
- end
2130
- end
2131
- end
2132
-
2133
- class MessageSpy
2134
- attr_reader :messages
2135
-
2136
- def initialize
2137
- @messages = []
2138
- end
2139
-
2140
- def legacy_messages
2141
- @messages - [
2142
- :before_test_step,
2143
- :before_test_case,
2144
- :after_test_step,
2145
- :after_test_case,
2146
- :done
2147
- ]
2148
- end
2149
-
2150
- def method_missing(message, *_args)
2151
- @messages << message
2152
- end
2153
-
2154
- def respond_to_missing?(_name, _include_private = false)
2155
- true
2156
- end
2157
- end
2158
-
2159
- def execute_gherkin(filters = default_filters, &gherkin)
2160
- runner = Core::Test::Runner.new(events)
2161
- compile [gherkin(&gherkin)], runner, filters
2162
- events.test_run_finished
2163
- self
2164
- end
2165
-
2166
- def default_filters
2167
- [
2168
- Filters::ActivateSteps.new(step_match_search, runtime.configuration),
2169
- AddBeforeAndAfterHooks.new
2170
- ]
2171
- end
2172
-
2173
- end
2174
- end
2175
- end