cucumber 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (424) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -4
  3. data/README.md +6 -5
  4. data/lib/cucumber/cli/options.rb +3 -1
  5. data/lib/cucumber/errors.rb +1 -1
  6. data/lib/cucumber/events.rb +0 -1
  7. data/lib/cucumber/events/test_step_finished.rb +0 -2
  8. data/lib/cucumber/events/test_step_started.rb +0 -2
  9. data/lib/cucumber/filters/quit.rb +0 -1
  10. data/lib/cucumber/formatter/html.rb +1 -1
  11. data/lib/cucumber/formatter/html_builder.rb +1 -1
  12. data/lib/cucumber/formatter/ignore_missing_messages.rb +0 -1
  13. data/lib/cucumber/formatter/json.rb +1 -1
  14. data/lib/cucumber/formatter/json_pretty.rb +0 -1
  15. data/lib/cucumber/formatter/rerun.rb +1 -1
  16. data/lib/cucumber/formatter/summary.rb +0 -1
  17. data/lib/cucumber/glue/proto_world.rb +2 -0
  18. data/lib/cucumber/glue/world_factory.rb +1 -1
  19. data/lib/cucumber/multiline_argument.rb +1 -1
  20. data/lib/cucumber/multiline_argument/data_table.rb +6 -10
  21. data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +0 -1
  22. data/lib/cucumber/step_definitions.rb +1 -1
  23. data/lib/cucumber/step_match.rb +1 -1
  24. data/lib/cucumber/step_match_search.rb +1 -1
  25. data/lib/cucumber/version +1 -1
  26. metadata +25 -563
  27. data/.coveralls.yml +0 -1
  28. data/.cucumberproignore +0 -6
  29. data/.gitattributes +0 -32
  30. data/.github/ISSUE_TEMPLATE.md +0 -48
  31. data/.github/PULL_REQUEST_TEMPLATE.md +0 -40
  32. data/.rspec +0 -1
  33. data/.rubocop.yml +0 -13
  34. data/.rubocop_todo.yml +0 -991
  35. data/.ruby-gemset +0 -1
  36. data/.travis.yml +0 -70
  37. data/.yardopts +0 -1
  38. data/Gemfile +0 -28
  39. data/Rakefile +0 -32
  40. data/appveyor.yml +0 -27
  41. data/cucumber.gemspec +0 -52
  42. data/cucumber.yml +0 -19
  43. data/examples/i18n/README.textile +0 -3
  44. data/examples/i18n/Rakefile +0 -33
  45. data/examples/i18n/ar/Rakefile +0 -6
  46. data/examples/i18n/ar/features/addition.feature +0 -17
  47. data/examples/i18n/ar/features/step_definitions/calculator_steps.rb +0 -29
  48. data/examples/i18n/ar/lib/calculator.rb +0 -11
  49. data/examples/i18n/bg/Rakefile +0 -6
  50. data/examples/i18n/bg/features/addition.feature +0 -12
  51. data/examples/i18n/bg/features/consecutive_calculations.feature +0 -19
  52. data/examples/i18n/bg/features/division.feature +0 -17
  53. data/examples/i18n/bg/features/step_definitions/calculator_steps.rb +0 -24
  54. data/examples/i18n/bg/features/support/env.rb +0 -10
  55. data/examples/i18n/bg/features/support/world.rb +0 -8
  56. data/examples/i18n/bg/lib/calculator.rb +0 -25
  57. data/examples/i18n/ca/Rakefile +0 -6
  58. data/examples/i18n/ca/features/step_definitions/calculator_steps.rb +0 -26
  59. data/examples/i18n/ca/features/suma.feature +0 -17
  60. data/examples/i18n/ca/lib/calculadora.rb +0 -16
  61. data/examples/i18n/cs/Rakefile +0 -6
  62. data/examples/i18n/cs/features/addition.feature +0 -17
  63. data/examples/i18n/cs/features/division.feature +0 -11
  64. data/examples/i18n/cs/features/step_definitions/calculator_steps.rb +0 -29
  65. data/examples/i18n/cs/lib/calculator.rb +0 -14
  66. data/examples/i18n/da/Rakefile +0 -6
  67. data/examples/i18n/da/features/sammenlaegning.feature +0 -18
  68. data/examples/i18n/da/features/step_definitions/lommeregner_steps.rb +0 -29
  69. data/examples/i18n/da/lib/lommeregner.rb +0 -11
  70. data/examples/i18n/de/Rakefile +0 -6
  71. data/examples/i18n/de/features/addition.feature +0 -17
  72. data/examples/i18n/de/features/division.feature +0 -10
  73. data/examples/i18n/de/features/step_definitions/calculator_steps.rb +0 -29
  74. data/examples/i18n/de/lib/calculator.rb +0 -14
  75. data/examples/i18n/el/Rakefile +0 -6
  76. data/examples/i18n/el/features/addition.feature +0 -17
  77. data/examples/i18n/el/features/division.feature +0 -10
  78. data/examples/i18n/el/features/step_definitions/calculator_steps.rb +0 -29
  79. data/examples/i18n/el/lib/calculator.rb +0 -14
  80. data/examples/i18n/en-lol/Rakefile +0 -4
  81. data/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb +0 -16
  82. data/examples/i18n/en-lol/features/stuffing.feature +0 -8
  83. data/examples/i18n/en-lol/features/support/env.rb +0 -11
  84. data/examples/i18n/en-lol/lib/basket.rb +0 -12
  85. data/examples/i18n/en-lol/lib/belly.rb +0 -11
  86. data/examples/i18n/en/Rakefile +0 -6
  87. data/examples/i18n/en/features/addition.feature +0 -17
  88. data/examples/i18n/en/features/division.feature +0 -10
  89. data/examples/i18n/en/features/step_definitions/calculator_steps.rb +0 -29
  90. data/examples/i18n/en/lib/calculator.rb +0 -14
  91. data/examples/i18n/eo/Rakefile +0 -6
  92. data/examples/i18n/eo/features/adicio.feature +0 -17
  93. data/examples/i18n/eo/features/divido.feature +0 -10
  94. data/examples/i18n/eo/features/step_definitions/calculator_steps.rb +0 -29
  95. data/examples/i18n/eo/lib/calculator.rb +0 -14
  96. data/examples/i18n/es/Rakefile +0 -6
  97. data/examples/i18n/es/features/adicion.feature +0 -17
  98. data/examples/i18n/es/features/step_definitions/calculador_steps.rb +0 -26
  99. data/examples/i18n/es/lib/calculador.rb +0 -14
  100. data/examples/i18n/et/Rakefile +0 -6
  101. data/examples/i18n/et/features/jagamine.feature +0 -10
  102. data/examples/i18n/et/features/liitmine.feature +0 -17
  103. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +0 -29
  104. data/examples/i18n/et/lib/kalkulaator.rb +0 -14
  105. data/examples/i18n/fi/Rakefile +0 -6
  106. data/examples/i18n/fi/features/jakolasku.feature +0 -10
  107. data/examples/i18n/fi/features/step_definitions/laskin_steps.rb +0 -29
  108. data/examples/i18n/fi/features/yhteenlasku.feature +0 -17
  109. data/examples/i18n/fi/lib/laskin.rb +0 -14
  110. data/examples/i18n/fr/Rakefile +0 -8
  111. data/examples/i18n/fr/features/addition.feature +0 -18
  112. data/examples/i18n/fr/features/addition2.feature +0 -17
  113. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +0 -32
  114. data/examples/i18n/fr/features/support/env.rb +0 -10
  115. data/examples/i18n/fr/lib/calculatrice.rb +0 -10
  116. data/examples/i18n/he/Rakefile +0 -6
  117. data/examples/i18n/he/features/addition.feature +0 -17
  118. data/examples/i18n/he/features/division.feature +0 -10
  119. data/examples/i18n/he/features/step_definitions/calculator_steps.rb +0 -29
  120. data/examples/i18n/he/lib/calculator.rb +0 -15
  121. data/examples/i18n/hi/Rakefile +0 -6
  122. data/examples/i18n/hi/features/addition.feature +0 -16
  123. data/examples/i18n/hi/features/division.feature +0 -10
  124. data/examples/i18n/hi/features/step_definitions/calculator_steps.rb +0 -29
  125. data/examples/i18n/hi/lib/calculator.rb +0 -15
  126. data/examples/i18n/ht/Rakefile +0 -6
  127. data/examples/i18n/ht/features/adisyon.feature +0 -17
  128. data/examples/i18n/ht/features/divizyon.feature +0 -10
  129. data/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb +0 -29
  130. data/examples/i18n/ht/lib/kalkilatris.rb +0 -14
  131. data/examples/i18n/hu/Rakefile +0 -6
  132. data/examples/i18n/hu/features/osszeadas.feature +0 -17
  133. data/examples/i18n/hu/features/osztas.feature +0 -10
  134. data/examples/i18n/hu/features/step_definitions/calculator_steps.rb +0 -30
  135. data/examples/i18n/hu/lib/calculator.rb +0 -14
  136. data/examples/i18n/id/Rakefile +0 -6
  137. data/examples/i18n/id/features/addition.feature +0 -17
  138. data/examples/i18n/id/features/division.feature +0 -10
  139. data/examples/i18n/id/features/step_definitions/calculator_steps.rb +0 -29
  140. data/examples/i18n/id/lib/calculator.rb +0 -14
  141. data/examples/i18n/it/Rakefile +0 -6
  142. data/examples/i18n/it/features/somma.feature +0 -11
  143. data/examples/i18n/it/features/step_definitions/calcolatrice_steps.rb +0 -29
  144. data/examples/i18n/it/lib/calcolatrice.rb +0 -11
  145. data/examples/i18n/ja/Rakefile +0 -6
  146. data/examples/i18n/ja/features/addition.feature +0 -17
  147. data/examples/i18n/ja/features/division.feature +0 -10
  148. data/examples/i18n/ja/features/step_definitions/calculator_steps.rb +0 -19
  149. data/examples/i18n/ja/features/support/env.rb +0 -10
  150. data/examples/i18n/ja/lib/calculator.rb +0 -14
  151. data/examples/i18n/ko/Rakefile +0 -6
  152. data/examples/i18n/ko/features/addition.feature +0 -17
  153. data/examples/i18n/ko/features/division.feature +0 -11
  154. data/examples/i18n/ko/features/step_definitions/calculator_steps.rb +0 -29
  155. data/examples/i18n/ko/lib/calculator.rb +0 -14
  156. data/examples/i18n/lt/Rakefile +0 -6
  157. data/examples/i18n/lt/features/addition.feature +0 -17
  158. data/examples/i18n/lt/features/division.feature +0 -10
  159. data/examples/i18n/lt/features/step_definitions/calculator_steps.rb +0 -29
  160. data/examples/i18n/lt/lib/calculator.rb +0 -14
  161. data/examples/i18n/lv/Rakefile +0 -6
  162. data/examples/i18n/lv/features/addition.feature +0 -17
  163. data/examples/i18n/lv/features/division.feature +0 -10
  164. data/examples/i18n/lv/features/step_definitions/calculator_steps.rb +0 -29
  165. data/examples/i18n/lv/lib/calculator.rb +0 -14
  166. data/examples/i18n/no/Rakefile +0 -6
  167. data/examples/i18n/no/features/step_definitions/kalkulator_steps.rb +0 -17
  168. data/examples/i18n/no/features/summering.feature +0 -19
  169. data/examples/i18n/no/features/support/env.rb +0 -11
  170. data/examples/i18n/no/lib/kalkulator.rb +0 -11
  171. data/examples/i18n/pl/Rakefile +0 -6
  172. data/examples/i18n/pl/features/addition.feature +0 -17
  173. data/examples/i18n/pl/features/division.feature +0 -10
  174. data/examples/i18n/pl/features/step_definitions/calculator_steps.rb +0 -29
  175. data/examples/i18n/pl/features/support/env.rb +0 -10
  176. data/examples/i18n/pl/lib/calculator.rb +0 -14
  177. data/examples/i18n/pt/Rakefile +0 -6
  178. data/examples/i18n/pt/features/adicao.feature +0 -11
  179. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +0 -20
  180. data/examples/i18n/pt/features/support/env.rb +0 -10
  181. data/examples/i18n/pt/lib/calculadora.rb +0 -10
  182. data/examples/i18n/ro/Rakefile +0 -6
  183. data/examples/i18n/ro/features/adunare.feature +0 -12
  184. data/examples/i18n/ro/features/step_definitions/calculator_steps.rb +0 -26
  185. data/examples/i18n/ro/lib/calculator.rb +0 -11
  186. data/examples/i18n/ru/Rakefile +0 -6
  187. data/examples/i18n/ru/features/addition.feature +0 -11
  188. data/examples/i18n/ru/features/consecutive_calculations.feature +0 -17
  189. data/examples/i18n/ru/features/division.feature +0 -16
  190. data/examples/i18n/ru/features/step_definitions/calculator_steps.rb +0 -19
  191. data/examples/i18n/ru/features/support/env.rb +0 -10
  192. data/examples/i18n/ru/features/support/world.rb +0 -8
  193. data/examples/i18n/ru/lib/calculator.rb +0 -25
  194. data/examples/i18n/sk/Rakefile +0 -6
  195. data/examples/i18n/sk/features/addition.feature +0 -17
  196. data/examples/i18n/sk/features/division.feature +0 -10
  197. data/examples/i18n/sk/features/step_definitions/calculator_steps.rb +0 -29
  198. data/examples/i18n/sk/lib/calculator.rb +0 -14
  199. data/examples/i18n/sr-Cyrl/Rakefile +0 -6
  200. data/examples/i18n/sr-Cyrl/features/sabiranje.feature +0 -18
  201. data/examples/i18n/sr-Cyrl/features/step_definitions/calculator_steps.rb +0 -20
  202. data/examples/i18n/sr-Cyrl/features/support/env.rb +0 -10
  203. data/examples/i18n/sr-Cyrl/lib/calculator.rb +0 -12
  204. data/examples/i18n/sr-Latn/Rakefile +0 -6
  205. data/examples/i18n/sr-Latn/features/sabiranje.feature +0 -18
  206. data/examples/i18n/sr-Latn/features/step_definitions/calculator_steps.rb +0 -29
  207. data/examples/i18n/sr-Latn/lib/calculator.rb +0 -12
  208. data/examples/i18n/sv/Rakefile +0 -6
  209. data/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb +0 -29
  210. data/examples/i18n/sv/features/summering.feature +0 -18
  211. data/examples/i18n/sv/lib/kalkulator.rb +0 -11
  212. data/examples/i18n/tr/Rakefile +0 -6
  213. data/examples/i18n/tr/features/bolme.feature +0 -10
  214. data/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb +0 -29
  215. data/examples/i18n/tr/features/toplama.feature +0 -18
  216. data/examples/i18n/tr/lib/hesap_makinesi.rb +0 -15
  217. data/examples/i18n/uk/Rakefile +0 -6
  218. data/examples/i18n/uk/features/addition.feature +0 -11
  219. data/examples/i18n/uk/features/consecutive_calculations.feature +0 -17
  220. data/examples/i18n/uk/features/division.feature +0 -16
  221. data/examples/i18n/uk/features/step_definitions/calculator_steps.rb +0 -19
  222. data/examples/i18n/uk/features/support/env.rb +0 -10
  223. data/examples/i18n/uk/features/support/world.rb +0 -8
  224. data/examples/i18n/uk/lib/calculator.rb +0 -25
  225. data/examples/i18n/uz/Rakefile +0 -6
  226. data/examples/i18n/uz/features/addition.feature +0 -10
  227. data/examples/i18n/uz/features/consecutive_calculations.feature +0 -17
  228. data/examples/i18n/uz/features/division.feature +0 -17
  229. data/examples/i18n/uz/features/step_definitions/calculator_steps.rb +0 -19
  230. data/examples/i18n/uz/features/support/env.rb +0 -10
  231. data/examples/i18n/uz/features/support/world.rb +0 -8
  232. data/examples/i18n/uz/lib/calculator.rb +0 -25
  233. data/examples/i18n/zh-CN/Rakefile +0 -4
  234. data/examples/i18n/zh-CN/features/addition.feature +0 -18
  235. data/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb +0 -31
  236. data/examples/i18n/zh-CN/lib/calculator.rb +0 -10
  237. data/examples/i18n/zh-TW/Rakefile +0 -4
  238. data/examples/i18n/zh-TW/features/addition.feature +0 -17
  239. data/examples/i18n/zh-TW/features/division.feature +0 -11
  240. data/examples/i18n/zh-TW/features/step_definitions/calculator_steps.rb +0 -29
  241. data/examples/i18n/zh-TW/lib/calculator.rb +0 -14
  242. data/examples/rspec_doubles/Rakefile +0 -4
  243. data/examples/rspec_doubles/features/mocking.feature +0 -9
  244. data/examples/rspec_doubles/features/step_definitions/calvin_steps.rb +0 -19
  245. data/examples/rspec_doubles/features/support/env.rb +0 -12
  246. data/examples/sinatra/README.textile +0 -13
  247. data/examples/sinatra/Rakefile +0 -6
  248. data/examples/sinatra/app.rb +0 -14
  249. data/examples/sinatra/features/add.feature +0 -11
  250. data/examples/sinatra/features/step_definitions/add_steps.rb +0 -15
  251. data/examples/sinatra/features/support/env.rb +0 -15
  252. data/examples/sinatra/views/add.erb +0 -7
  253. data/examples/sinatra/views/layout.erb +0 -8
  254. data/examples/tcl/README.textile +0 -11
  255. data/examples/tcl/Rakefile +0 -6
  256. data/examples/tcl/features/fibonnacci.feature +0 -17
  257. data/examples/tcl/features/step_definitions/fib_steps.rb +0 -7
  258. data/examples/tcl/features/support/env.rb +0 -7
  259. data/examples/tcl/src/fib.tcl +0 -3
  260. data/examples/test_unit/Gemfile +0 -4
  261. data/examples/test_unit/Rakefile +0 -6
  262. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +0 -20
  263. data/examples/test_unit/features/test_unit.feature +0 -9
  264. data/examples/watir/README.textile +0 -16
  265. data/examples/watir/Rakefile +0 -12
  266. data/examples/watir/cucumber.yml +0 -1
  267. data/examples/watir/features/search.feature +0 -12
  268. data/examples/watir/features/step_definitions/search_steps.rb +0 -27
  269. data/examples/watir/features/support/env.rb +0 -39
  270. data/examples/watir/features/support/screenshots.rb +0 -47
  271. data/features/docs/api/list_step_defs_as_json.feature +0 -64
  272. data/features/docs/api/listen_for_events.feature +0 -59
  273. data/features/docs/api/run_cli_main_with_existing_runtime.feature +0 -27
  274. data/features/docs/cli/backtraces.feature +0 -36
  275. data/features/docs/cli/dry_run.feature +0 -73
  276. data/features/docs/cli/exclude_files.feature +0 -18
  277. data/features/docs/cli/execute_with_tag_filter.feature +0 -119
  278. data/features/docs/cli/fail_fast.feature +0 -48
  279. data/features/docs/cli/finding_steps.feature +0 -28
  280. data/features/docs/cli/help.feature +0 -8
  281. data/features/docs/cli/i18n.feature +0 -42
  282. data/features/docs/cli/randomize.feature +0 -140
  283. data/features/docs/cli/require.feature +0 -27
  284. data/features/docs/cli/retry_failing_tests.feature +0 -92
  285. data/features/docs/cli/run_scenarios_matching_name.feature +0 -105
  286. data/features/docs/cli/run_specific_scenarios.feature +0 -77
  287. data/features/docs/cli/showing_differences.feature +0 -43
  288. data/features/docs/cli/specifying_multiple_formatters.feature +0 -68
  289. data/features/docs/cli/strict_mode.feature +0 -70
  290. data/features/docs/defining_steps/ambiguous_steps.feature +0 -89
  291. data/features/docs/defining_steps/nested_steps.feature +0 -181
  292. data/features/docs/defining_steps/nested_steps_i18n.feature +0 -37
  293. data/features/docs/defining_steps/nested_steps_with_second_arg.feature +0 -56
  294. data/features/docs/defining_steps/one_line_step_definitions.feature +0 -65
  295. data/features/docs/defining_steps/printing_messages.feature +0 -147
  296. data/features/docs/defining_steps/skip_scenario.feature +0 -31
  297. data/features/docs/defining_steps/snippets.feature +0 -56
  298. data/features/docs/defining_steps/table_diffing.feature +0 -50
  299. data/features/docs/events/gherkin_source_read_event.feature +0 -43
  300. data/features/docs/events/step_activated_event.feature +0 -36
  301. data/features/docs/events/step_definition_registered_event.feature +0 -29
  302. data/features/docs/events/test_case_finished_event.feature +0 -35
  303. data/features/docs/events/test_case_started_event.feature +0 -54
  304. data/features/docs/events/test_run_finished_event.feature +0 -40
  305. data/features/docs/events/test_run_started_event.feature +0 -41
  306. data/features/docs/events/test_step_finished_event.feature +0 -47
  307. data/features/docs/events/test_step_started_event.feature +0 -43
  308. data/features/docs/exception_in_after_hook.feature +0 -127
  309. data/features/docs/exception_in_after_step_hook.feature +0 -104
  310. data/features/docs/exception_in_around_hook.feature +0 -80
  311. data/features/docs/exception_in_before_hook.feature +0 -98
  312. data/features/docs/extending_cucumber/custom_filter.feature +0 -29
  313. data/features/docs/extending_cucumber/custom_formatter.feature +0 -94
  314. data/features/docs/formatters/api_methods.feature +0 -37
  315. data/features/docs/formatters/html_formatter.feature +0 -91
  316. data/features/docs/formatters/json_formatter.feature +0 -767
  317. data/features/docs/formatters/junit_formatter.feature +0 -455
  318. data/features/docs/formatters/pretty_formatter.feature +0 -74
  319. data/features/docs/formatters/progress_formatter.feature +0 -32
  320. data/features/docs/formatters/rerun_formatter.feature +0 -190
  321. data/features/docs/formatters/summary_formatter.feature +0 -35
  322. data/features/docs/formatters/usage_formatter.feature +0 -101
  323. data/features/docs/getting_started.feature +0 -28
  324. data/features/docs/gherkin/background.feature +0 -548
  325. data/features/docs/gherkin/doc_strings.feature +0 -76
  326. data/features/docs/gherkin/expand_option_for_outlines.feature +0 -47
  327. data/features/docs/gherkin/language_from_header.feature +0 -32
  328. data/features/docs/gherkin/outlines.feature +0 -158
  329. data/features/docs/gherkin/unicode_table.feature +0 -33
  330. data/features/docs/gherkin/using_descriptions.feature +0 -83
  331. data/features/docs/gherkin/using_star_notation.feature +0 -37
  332. data/features/docs/iso-8859-1.feature +0 -6
  333. data/features/docs/post_configuration_hook.feature +0 -33
  334. data/features/docs/profiles.feature +0 -120
  335. data/features/docs/rake_task.feature +0 -146
  336. data/features/docs/raketask.feature +0 -46
  337. data/features/docs/work_in_progress.feature +0 -157
  338. data/features/docs/writing_support_code/after_hooks.feature +0 -102
  339. data/features/docs/writing_support_code/after_step_hooks.feature +0 -55
  340. data/features/docs/writing_support_code/around_hooks.feature +0 -266
  341. data/features/docs/writing_support_code/before_hook.feature +0 -66
  342. data/features/docs/writing_support_code/hook_order.feature +0 -63
  343. data/features/docs/writing_support_code/load_path.feature +0 -17
  344. data/features/docs/writing_support_code/parameter_types.feature +0 -69
  345. data/features/docs/writing_support_code/state.feature +0 -32
  346. data/features/docs/writing_support_code/tagged_hooks.feature +0 -95
  347. data/features/docs/writing_support_code/world.feature +0 -129
  348. data/features/lib/step_definitions/aruba_steps.rb +0 -21
  349. data/features/lib/step_definitions/cli_steps.rb +0 -4
  350. data/features/lib/step_definitions/cucumber_steps.rb +0 -75
  351. data/features/lib/step_definitions/iso-8859-1_steps.rb +0 -16
  352. data/features/lib/step_definitions/json_steps.rb +0 -8
  353. data/features/lib/step_definitions/junit_steps.rb +0 -14
  354. data/features/lib/step_definitions/language_steps.rb +0 -9
  355. data/features/lib/step_definitions/profile_steps.rb +0 -16
  356. data/features/lib/step_definitions/retry_steps.rb +0 -55
  357. data/features/lib/step_definitions/ruby_steps.rb +0 -4
  358. data/features/lib/support/env.rb +0 -22
  359. data/features/lib/support/fake_wire_server.rb +0 -94
  360. data/features/lib/support/feature_factory.rb +0 -68
  361. data/features/lib/support/normalise_output.rb +0 -52
  362. data/features/lib/support/parameter_types.rb +0 -5
  363. data/gem_tasks/contributors.rake +0 -19
  364. data/gem_tasks/cov.rake +0 -6
  365. data/gem_tasks/downloads.rb +0 -8
  366. data/gem_tasks/environment.rake +0 -4
  367. data/gem_tasks/examples.rake +0 -12
  368. data/gem_tasks/fix_cr_lf.rake +0 -22
  369. data/gem_tasks/flog.rake +0 -5
  370. data/gem_tasks/rspec.rake +0 -7
  371. data/gem_tasks/sass.rake +0 -5
  372. data/gem_tasks/stats +0 -16
  373. data/gem_tasks/versions.txt +0 -74
  374. data/scripts/invite-collaborator +0 -40
  375. data/scripts/update-changelog +0 -86
  376. data/spec/cucumber/cli/configuration_spec.rb +0 -446
  377. data/spec/cucumber/cli/main_spec.rb +0 -84
  378. data/spec/cucumber/cli/options_spec.rb +0 -445
  379. data/spec/cucumber/cli/profile_loader_spec.rb +0 -66
  380. data/spec/cucumber/cli/rerun_spec.rb +0 -86
  381. data/spec/cucumber/configuration_spec.rb +0 -148
  382. data/spec/cucumber/constantize_spec.rb +0 -20
  383. data/spec/cucumber/events_spec.rb +0 -9
  384. data/spec/cucumber/file_specs_spec.rb +0 -61
  385. data/spec/cucumber/filters/activate_steps_spec.rb +0 -152
  386. data/spec/cucumber/filters/gated_receiver_spec.rb +0 -48
  387. data/spec/cucumber/filters/retry_spec.rb +0 -98
  388. data/spec/cucumber/filters/tag_limits/test_case_index_spec.rb +0 -39
  389. data/spec/cucumber/filters/tag_limits/verifier_spec.rb +0 -58
  390. data/spec/cucumber/filters/tag_limits_spec.rb +0 -60
  391. data/spec/cucumber/formatter/ansicolor_spec.rb +0 -33
  392. data/spec/cucumber/formatter/backtrace_filter_spec.rb +0 -32
  393. data/spec/cucumber/formatter/console_counts_spec.rb +0 -14
  394. data/spec/cucumber/formatter/duration_spec.rb +0 -23
  395. data/spec/cucumber/formatter/fail_fast_spec.rb +0 -88
  396. data/spec/cucumber/formatter/html_spec.rb +0 -543
  397. data/spec/cucumber/formatter/interceptor_spec.rb +0 -137
  398. data/spec/cucumber/formatter/json_spec.rb +0 -815
  399. data/spec/cucumber/formatter/junit_spec.rb +0 -251
  400. data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +0 -2175
  401. data/spec/cucumber/formatter/pretty_spec.rb +0 -907
  402. data/spec/cucumber/formatter/progress_spec.rb +0 -170
  403. data/spec/cucumber/formatter/rerun_spec.rb +0 -97
  404. data/spec/cucumber/formatter/spec_helper.rb +0 -84
  405. data/spec/cucumber/glue/proto_world_spec.rb +0 -63
  406. data/spec/cucumber/glue/registry_and_more_spec.rb +0 -213
  407. data/spec/cucumber/glue/snippet_spec.rb +0 -174
  408. data/spec/cucumber/glue/step_definition_spec.rb +0 -207
  409. data/spec/cucumber/hooks_spec.rb +0 -31
  410. data/spec/cucumber/multiline_argument/data_table_spec.rb +0 -653
  411. data/spec/cucumber/project_initializer_spec.rb +0 -88
  412. data/spec/cucumber/rake/forked_spec.rb +0 -58
  413. data/spec/cucumber/rake/task_spec.rb +0 -86
  414. data/spec/cucumber/running_test_case_spec.rb +0 -140
  415. data/spec/cucumber/runtime/for_programming_languages_spec.rb +0 -8
  416. data/spec/cucumber/runtime/support_code_spec.rb +0 -17
  417. data/spec/cucumber/runtime_spec.rb +0 -21
  418. data/spec/cucumber/sell_cucumbers.feature +0 -19
  419. data/spec/cucumber/step_argument_spec.rb +0 -19
  420. data/spec/cucumber/step_match_search_spec.rb +0 -113
  421. data/spec/cucumber/step_match_spec.rb +0 -86
  422. data/spec/cucumber/world/pending_spec.rb +0 -48
  423. data/spec/spec_helper.rb +0 -30
  424. data/spec/support/standard_step_actions.rb +0 -19
@@ -1,137 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'spec_helper'
3
- require 'cucumber/formatter/interceptor'
4
-
5
- module Cucumber::Formatter
6
- describe Interceptor::Pipe do
7
- let(:pipe) do
8
- pipe = double('original pipe')
9
-
10
- allow(pipe).to receive(:instance_of?) { true }
11
-
12
- pipe
13
- end
14
-
15
- describe '#wrap!' do
16
- it 'raises an ArgumentError if its not passed :stderr/:stdout' do
17
- expect {
18
- Interceptor::Pipe.wrap(:nonsense)
19
- }.to raise_error(ArgumentError)
20
- end
21
-
22
- context 'when passed :stderr' do
23
- before :each do
24
- @stderr = $stdout
25
- end
26
-
27
- it 'wraps $stderr' do
28
- wrapped = Interceptor::Pipe.wrap(:stderr)
29
-
30
- expect($stderr).to be_instance_of Interceptor::Pipe
31
- expect($stderr).to be wrapped
32
- end
33
-
34
- after :each do
35
- $stderr = @stderr
36
- end
37
- end
38
-
39
- context 'when passed :stdout' do
40
- before :each do
41
- @stdout = $stdout
42
- end
43
-
44
- it 'wraps $stdout' do
45
- wrapped = Interceptor::Pipe.wrap(:stdout)
46
-
47
- expect($stdout).to be_instance_of Interceptor::Pipe
48
- expect($stdout).to be wrapped
49
- end
50
-
51
- after :each do
52
- $stdout = @stdout
53
- end
54
- end
55
- end
56
-
57
- describe '#unwrap!' do
58
- before :each do
59
- @stdout = $stdout
60
- @wrapped = Interceptor::Pipe.wrap(:stdout)
61
- end
62
-
63
- it 'raises an ArgumentError if it wasn\'t passed :stderr/:stdout' do
64
- expect {
65
- Interceptor::Pipe.unwrap!(:nonsense)
66
- }.to raise_error(ArgumentError)
67
- end
68
-
69
- it 'resets $stdout when #unwrap! is called' do
70
- interceptor = Interceptor::Pipe.unwrap! :stdout
71
-
72
- expect(interceptor).to be_instance_of Interceptor::Pipe
73
- expect($stdout).not_to be interceptor
74
- end
75
-
76
- it 'noops if $stdout or $stderr has been overwritten' do
77
- $stdout = StringIO.new
78
- pipe = Interceptor::Pipe.unwrap! :stdout
79
- expect(pipe).to eq $stdout
80
-
81
- $stderr = StringIO.new
82
- pipe = Interceptor::Pipe.unwrap! :stderr
83
- expect(pipe).to eq $stderr
84
- end
85
-
86
- it 'disables the pipe bypass' do
87
- buffer = '(::)'
88
- Interceptor::Pipe.unwrap! :stdout
89
-
90
- expect(@wrapped).to receive(:write).with(buffer)
91
- expect(@wrapped.buffer).not_to receive(:<<)
92
-
93
- @wrapped.write(buffer)
94
- end
95
-
96
- after :each do
97
- $stdout = @stdout
98
- end
99
- end
100
-
101
- describe '#write' do
102
- let(:buffer) { 'Some stupid buffer' }
103
- let(:pi) { Interceptor::Pipe.new(pipe) }
104
-
105
- it 'writes arguments to the original pipe' do
106
- expect(pipe).to receive(:write).with(buffer) { buffer.size }
107
- expect(pi.write(buffer)).to eq buffer.size
108
- end
109
-
110
- it 'adds the buffer to its stored output' do
111
- allow(pipe).to receive(:write)
112
-
113
- pi.write(buffer)
114
-
115
- expect(pi.buffer).not_to be_empty
116
- expect(pi.buffer.first).to eq buffer
117
- end
118
- end
119
-
120
- describe '#method_missing' do
121
- let(:pi) { Interceptor::Pipe.new(pipe) }
122
-
123
- it 'passes #tty? to the original pipe' do
124
- expect(pipe).to receive(:tty?) { true }
125
- expect(pi.tty?).to be true
126
- end
127
- end
128
-
129
- describe '#respond_to' do
130
- let(:pi) { Interceptor::Pipe.wrap(:stderr) }
131
-
132
- it 'responds to all methods $stderr has' do
133
- $stderr.methods.each { |m| expect(pi.respond_to?(m)).to be true }
134
- end
135
- end
136
- end
137
- end
@@ -1,815 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'spec_helper'
3
- require 'cucumber/formatter/spec_helper'
4
- require 'cucumber/formatter/json'
5
- require 'cucumber/cli/options'
6
- require 'multi_json'
7
-
8
- module Cucumber
9
- module Formatter
10
- describe Json do
11
- extend SpecHelperDsl
12
- include SpecHelper
13
-
14
- context 'Given a single feature' do
15
- before(:each) do
16
- @out = StringIO.new
17
- @formatter = Json.new(actual_runtime.configuration.with_options(out_stream: @out))
18
- run_defined_feature
19
- end
20
-
21
- describe 'with a scenario with an undefined step' do
22
- define_feature <<-FEATURE
23
- Feature: Banana party
24
-
25
- Scenario: Monkey eats bananas
26
- Given there are bananas
27
- FEATURE
28
-
29
- it 'outputs the json data' do
30
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
31
- [{"id": "banana-party",
32
- "uri": "spec.feature",
33
- "keyword": "Feature",
34
- "name": "Banana party",
35
- "line": 1,
36
- "description": "",
37
- "elements":
38
- [{"id": "banana-party;monkey-eats-bananas",
39
- "keyword": "Scenario",
40
- "name": "Monkey eats bananas",
41
- "line": 3,
42
- "description": "",
43
- "type": "scenario",
44
- "steps":
45
- [{"keyword": "Given ",
46
- "name": "there are bananas",
47
- "line": 4,
48
- "match": {"location": "spec.feature:4"},
49
- "result": {"status": "undefined"}}]}]}]})
50
- end
51
- end
52
-
53
- describe 'with a scenario with a passed step' do
54
- define_feature <<-FEATURE
55
- Feature: Banana party
56
-
57
- Scenario: Monkey eats bananas
58
- Given there are bananas
59
- FEATURE
60
-
61
- define_steps do
62
- Given(/^there are bananas$/) {}
63
- end
64
-
65
- it 'outputs the json data' do
66
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
67
- [{"id": "banana-party",
68
- "uri": "spec.feature",
69
- "keyword": "Feature",
70
- "name": "Banana party",
71
- "line": 1,
72
- "description": "",
73
- "elements":
74
- [{"id": "banana-party;monkey-eats-bananas",
75
- "keyword": "Scenario",
76
- "name": "Monkey eats bananas",
77
- "line": 3,
78
- "description": "",
79
- "type": "scenario",
80
- "steps":
81
- [{"keyword": "Given ",
82
- "name": "there are bananas",
83
- "line": 4,
84
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:62"},
85
- "result": {"status": "passed",
86
- "duration": 1}}]}]}]})
87
- end
88
- end
89
-
90
- describe 'with a scenario with a failed step' do
91
- define_feature <<-FEATURE
92
- Feature: Banana party
93
-
94
- Scenario: Monkey eats bananas
95
- Given there are bananas
96
- FEATURE
97
-
98
- define_steps do
99
- Given(/^there are bananas$/) { raise 'no bananas' }
100
- end
101
-
102
- it 'outputs the json data' do
103
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
104
- [{"id": "banana-party",
105
- "uri": "spec.feature",
106
- "keyword": "Feature",
107
- "name": "Banana party",
108
- "line": 1,
109
- "description": "",
110
- "elements":
111
- [{"id": "banana-party;monkey-eats-bananas",
112
- "keyword": "Scenario",
113
- "name": "Monkey eats bananas",
114
- "line": 3,
115
- "description": "",
116
- "type": "scenario",
117
- "steps":
118
- [{"keyword": "Given ",
119
- "name": "there are bananas",
120
- "line": 4,
121
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:99"},
122
- "result": {"status": "failed",
123
- "error_message": "no bananas (RuntimeError)\\n./spec/cucumber/formatter/json_spec.rb:99:in `/^there are bananas$/'\\nspec.feature:4:in `Given there are bananas'",
124
- "duration": 1}}]}]}]})
125
- end
126
- end
127
-
128
- describe 'with a scenario with a pending step' do
129
- define_feature <<-FEATURE
130
- Feature: Banana party
131
-
132
- Scenario: Monkey eats bananas
133
- Given there are bananas
134
- FEATURE
135
-
136
- define_steps do
137
- Given(/^there are bananas$/) { pending }
138
- end
139
-
140
- it 'outputs the json data' do
141
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
142
- [{"id": "banana-party",
143
- "uri": "spec.feature",
144
- "keyword": "Feature",
145
- "name": "Banana party",
146
- "line": 1,
147
- "description": "",
148
- "elements":
149
- [{"id": "banana-party;monkey-eats-bananas",
150
- "keyword": "Scenario",
151
- "name": "Monkey eats bananas",
152
- "line": 3,
153
- "description": "",
154
- "type": "scenario",
155
- "steps":
156
- [{"keyword": "Given ",
157
- "name": "there are bananas",
158
- "line": 4,
159
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:137"},
160
- "result": {"status": "pending",
161
- "error_message": "TODO (Cucumber::Pending)\\n./spec/cucumber/formatter/json_spec.rb:137:in `/^there are bananas$/'\\nspec.feature:4:in `Given there are bananas'",
162
- "duration": 1}}]}]}]})
163
- end
164
- end
165
-
166
- describe 'with a scenario outline with one example' do
167
- define_feature <<-FEATURE
168
- Feature: Banana party
169
-
170
- Scenario Outline: Monkey eats bananas
171
- Given there are <fruit>
172
-
173
- Examples: Fruit Table
174
- | fruit |
175
- | bananas |
176
- FEATURE
177
-
178
- define_steps do
179
- Given(/^there are bananas$/) {}
180
- end
181
-
182
- it 'outputs the json data' do
183
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
184
- [{"id": "banana-party",
185
- "uri": "spec.feature",
186
- "keyword": "Feature",
187
- "name": "Banana party",
188
- "line": 1,
189
- "description": "",
190
- "elements":
191
- [{"id": "banana-party;monkey-eats-bananas;fruit-table;2",
192
- "keyword": "Scenario Outline",
193
- "name": "Monkey eats bananas",
194
- "line": 8,
195
- "description": "",
196
- "type": "scenario",
197
- "steps":
198
- [{"keyword": "Given ",
199
- "name": "there are bananas",
200
- "line": 8,
201
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:179"},
202
- "result": {"status": "passed",
203
- "duration": 1}}]}]}]})
204
- end
205
- end
206
-
207
- describe 'with tags in the feature file' do
208
- define_feature <<-FEATURE
209
- @f
210
- Feature: Banana party
211
-
212
- @s
213
- Scenario: Monkey eats bananas
214
- Given there are bananas
215
-
216
- @so
217
- Scenario Outline: Monkey eats bananas
218
- Given there are <fruit>
219
-
220
- @ex
221
- Examples: Fruit Table
222
- | fruit |
223
- | bananas |
224
- FEATURE
225
-
226
- define_steps do
227
- Given(/^there are bananas$/) {}
228
- end
229
-
230
- it 'the tags are included in the json data' do
231
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
232
- [{"id": "banana-party",
233
- "uri": "spec.feature",
234
- "keyword": "Feature",
235
- "name": "Banana party",
236
- "line": 2,
237
- "description": "",
238
- "tags": [{"name": "@f",
239
- "line": 1}],
240
- "elements":
241
- [{"id": "banana-party;monkey-eats-bananas",
242
- "keyword": "Scenario",
243
- "name": "Monkey eats bananas",
244
- "line": 5,
245
- "description": "",
246
- "tags": [{"name": "@f",
247
- "line": 1},
248
- {"name": "@s",
249
- "line": 4}],
250
- "type": "scenario",
251
- "steps":
252
- [{"keyword": "Given ",
253
- "name": "there are bananas",
254
- "line": 6,
255
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:227"},
256
- "result": {"status": "passed",
257
- "duration": 1}}]},
258
- {"id": "banana-party;monkey-eats-bananas;fruit-table;2",
259
- "keyword": "Scenario Outline",
260
- "name": "Monkey eats bananas",
261
- "line": 15,
262
- "description": "",
263
- "tags": [{"name": "@f",
264
- "line": 1},
265
- {"name": "@so",
266
- "line": 8},
267
- {"name": "@ex",
268
- "line": 12}],
269
- "type": "scenario",
270
- "steps":
271
- [{"keyword": "Given ",
272
- "name": "there are bananas",
273
- "line": 15,
274
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:227"},
275
- "result": {"status": "passed",
276
- "duration": 1}}]}]}]})
277
- end
278
- end
279
-
280
- describe 'with comments in the feature file' do
281
- define_feature <<-FEATURE
282
- #feature comment
283
- Feature: Banana party
284
-
285
- #background comment
286
- Background: There are bananas
287
- Given there are bananas
288
-
289
- #scenario comment
290
- Scenario: Monkey eats bananas
291
- #step comment1
292
- Then the monkey eats bananas
293
-
294
- #scenario outline comment
295
- Scenario Outline: Monkey eats bananas
296
- #step comment2
297
- Then the monkey eats <fruit>
298
-
299
- #examples table comment
300
- Examples: Fruit Table
301
- | fruit |
302
- #examples table row comment
303
- | bananas |
304
- FEATURE
305
-
306
- define_steps do
307
- Given(/^there are bananas$/) {}
308
- Then(/^the monkey eats bananas$/) {}
309
- end
310
-
311
- it 'the comments are included in the json data' do
312
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
313
- [{"id": "banana-party",
314
- "uri": "spec.feature",
315
- "keyword": "Feature",
316
- "name": "Banana party",
317
- "line": 2,
318
- "description": "",
319
- "comments": [{"value": "#feature comment",
320
- "line": 1}],
321
- "elements":
322
- [{"keyword": "Background",
323
- "name": "There are bananas",
324
- "line": 5,
325
- "description": "",
326
- "comments": [{"value": "#background comment",
327
- "line": 4}],
328
- "type": "background",
329
- "steps":
330
- [{"keyword": "Given ",
331
- "name": "there are bananas",
332
- "line": 6,
333
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:307"},
334
- "result": {"status": "passed",
335
- "duration": 1}}]},
336
- {"id": "banana-party;monkey-eats-bananas",
337
- "keyword": "Scenario",
338
- "name": "Monkey eats bananas",
339
- "line": 9,
340
- "description": "",
341
- "comments": [{"value": "#scenario comment",
342
- "line": 8}],
343
- "type": "scenario",
344
- "steps":
345
- [{"keyword": "Then ",
346
- "name": "the monkey eats bananas",
347
- "line": 11,
348
- "comments": [{"value": "#step comment1",
349
- "line": 10}],
350
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:308"},
351
- "result": {"status": "passed",
352
- "duration": 1}}]},
353
- {"keyword": "Background",
354
- "name": "There are bananas",
355
- "line": 5,
356
- "description": "",
357
- "comments": [{"value": "#background comment",
358
- "line": 4}],
359
- "type": "background",
360
- "steps":
361
- [{"keyword": "Given ",
362
- "name": "there are bananas",
363
- "line": 6,
364
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:307"},
365
- "result": {"status": "passed",
366
- "duration": 1}}]},
367
- {"id": "banana-party;monkey-eats-bananas;fruit-table;2",
368
- "keyword": "Scenario Outline",
369
- "name": "Monkey eats bananas",
370
- "line": 22,
371
- "description": "",
372
- "comments": [{"value": "#scenario outline comment",
373
- "line": 13},
374
- {"value": "#examples table comment",
375
- "line": 18},
376
- {"value": "#examples table row comment",
377
- "line": 21}],
378
- "type": "scenario",
379
- "steps":
380
- [{"keyword": "Then ",
381
- "name": "the monkey eats bananas",
382
- "line": 22,
383
- "comments": [{"value": "#step comment2",
384
- "line": 15}],
385
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:308"},
386
- "result": {"status": "passed",
387
- "duration": 1}}]}]}]})
388
- end
389
- end
390
-
391
- describe 'with a scenario with a step with a doc string' do
392
- define_feature <<-FEATURE
393
- Feature: Banana party
394
-
395
- Scenario: Monkey eats bananas
396
- Given there are bananas
397
- """
398
- the doc string
399
- """
400
- FEATURE
401
-
402
- define_steps do
403
- Given(/^there are bananas$/) { |s| s }
404
- end
405
-
406
- it 'includes the doc string in the json data' do
407
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
408
- [{"id": "banana-party",
409
- "uri": "spec.feature",
410
- "keyword": "Feature",
411
- "name": "Banana party",
412
- "line": 1,
413
- "description": "",
414
- "elements":
415
- [{"id": "banana-party;monkey-eats-bananas",
416
- "keyword": "Scenario",
417
- "name": "Monkey eats bananas",
418
- "line": 3,
419
- "description": "",
420
- "type": "scenario",
421
- "steps":
422
- [{"keyword": "Given ",
423
- "name": "there are bananas",
424
- "line": 4,
425
- "doc_string": {"value": "the doc string",
426
- "content_type": "",
427
- "line": 5},
428
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:403"},
429
- "result": {"status": "passed",
430
- "duration": 1}}]}]}]})
431
- end
432
- end
433
-
434
- describe 'with a scenario with a step that use puts' do
435
- define_feature <<-FEATURE
436
- Feature: Banana party
437
-
438
- Scenario: Monkey eats bananas
439
- Given there are bananas
440
- FEATURE
441
-
442
- define_steps do
443
- Given(/^there are bananas$/) { puts 'from step' }
444
- end
445
-
446
- it 'includes the output from the step in the json data' do
447
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
448
- [{"id": "banana-party",
449
- "uri": "spec.feature",
450
- "keyword": "Feature",
451
- "name": "Banana party",
452
- "line": 1,
453
- "description": "",
454
- "elements":
455
- [{"id": "banana-party;monkey-eats-bananas",
456
- "keyword": "Scenario",
457
- "name": "Monkey eats bananas",
458
- "line": 3,
459
- "description": "",
460
- "type": "scenario",
461
- "steps":
462
- [{"keyword": "Given ",
463
- "name": "there are bananas",
464
- "line": 4,
465
- "output": ["from step"],
466
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:443"},
467
- "result": {"status": "passed",
468
- "duration": 1}}]}]}]})
469
- end
470
- end
471
-
472
- describe 'with a background' do
473
- define_feature <<-FEATURE
474
- Feature: Banana party
475
-
476
- Background: There are bananas
477
- Given there are bananas
478
-
479
- Scenario: Monkey eats bananas
480
- Then the monkey eats bananas
481
-
482
- Scenario: Monkey eats more bananas
483
- Then the monkey eats more bananas
484
- FEATURE
485
-
486
- it 'includes the background in the json data each time it is executed' do
487
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
488
- [{"id": "banana-party",
489
- "uri": "spec.feature",
490
- "keyword": "Feature",
491
- "name": "Banana party",
492
- "line": 1,
493
- "description": "",
494
- "elements":
495
- [{"keyword": "Background",
496
- "name": "There are bananas",
497
- "line": 3,
498
- "description": "",
499
- "type": "background",
500
- "steps":
501
- [{"keyword": "Given ",
502
- "name": "there are bananas",
503
- "line": 4,
504
- "match": {"location": "spec.feature:4"},
505
- "result": {"status": "undefined"}}]},
506
- {"id": "banana-party;monkey-eats-bananas",
507
- "keyword": "Scenario",
508
- "name": "Monkey eats bananas",
509
- "line": 6,
510
- "description": "",
511
- "type": "scenario",
512
- "steps":
513
- [{"keyword": "Then ",
514
- "name": "the monkey eats bananas",
515
- "line": 7,
516
- "match": {"location": "spec.feature:7"},
517
- "result": {"status": "undefined"}}]},
518
- {"keyword": "Background",
519
- "name": "There are bananas",
520
- "line": 3,
521
- "description": "",
522
- "type": "background",
523
- "steps":
524
- [{"keyword": "Given ",
525
- "name": "there are bananas",
526
- "line": 4,
527
- "match": {"location": "spec.feature:4"},
528
- "result": {"status": "undefined"}}]},
529
- {"id": "banana-party;monkey-eats-more-bananas",
530
- "keyword": "Scenario",
531
- "name": "Monkey eats more bananas",
532
- "line": 9,
533
- "description": "",
534
- "type": "scenario",
535
- "steps":
536
- [{"keyword": "Then ",
537
- "name": "the monkey eats more bananas",
538
- "line": 10,
539
- "match": {"location": "spec.feature:10"},
540
- "result": {"status": "undefined"}}]}]}]})
541
- end
542
- end
543
-
544
- describe 'with a scenario with a step that embeds data directly' do
545
- define_feature <<-FEATURE
546
- Feature: Banana party
547
-
548
- Scenario: Monkey eats bananas
549
- Given there are bananas
550
- FEATURE
551
-
552
- define_steps do
553
- Given(/^there are bananas$/) { data = 'YWJj'
554
- embed data, 'mime-type;base64' }
555
- end
556
-
557
- it 'includes the data from the step in the json data' do
558
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
559
- [{"id": "banana-party",
560
- "uri": "spec.feature",
561
- "keyword": "Feature",
562
- "name": "Banana party",
563
- "line": 1,
564
- "description": "",
565
- "elements":
566
- [{"id": "banana-party;monkey-eats-bananas",
567
- "keyword": "Scenario",
568
- "name": "Monkey eats bananas",
569
- "line": 3,
570
- "description": "",
571
- "type": "scenario",
572
- "steps":
573
- [{"keyword": "Given ",
574
- "name": "there are bananas",
575
- "line": 4,
576
- "embeddings": [{"mime_type": "mime-type",
577
- "data": "YWJj"}],
578
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:553"},
579
- "result": {"status": "passed",
580
- "duration": 1}}]}]}]})
581
- end
582
- end
583
-
584
- describe 'with a scenario with a step that embeds a file' do
585
- define_feature <<-FEATURE
586
- Feature: Banana party
587
-
588
- Scenario: Monkey eats bananas
589
- Given there are bananas
590
- FEATURE
591
-
592
- define_steps do
593
- Given(/^there are bananas$/) {
594
- RSpec::Mocks.allow_message(File, :file?) { true }
595
- f1 = RSpec::Mocks::Double.new
596
- RSpec::Mocks.allow_message(File, :open) { |&block| block.call(f1) }
597
- RSpec::Mocks.allow_message(f1, :read) { 'foo' }
598
- embed('out/snapshot.jpeg', 'image/png')
599
- }
600
- end
601
-
602
- it 'includes the file content in the json data' do
603
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
604
- [{"id": "banana-party",
605
- "uri": "spec.feature",
606
- "keyword": "Feature",
607
- "name": "Banana party",
608
- "line": 1,
609
- "description": "",
610
- "elements":
611
- [{"id": "banana-party;monkey-eats-bananas",
612
- "keyword": "Scenario",
613
- "name": "Monkey eats bananas",
614
- "line": 3,
615
- "description": "",
616
- "type": "scenario",
617
- "steps":
618
- [{"keyword": "Given ",
619
- "name": "there are bananas",
620
- "line": 4,
621
- "embeddings": [{"mime_type": "image/png",
622
- "data": "Zm9v"}],
623
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:593"},
624
- "result": {"status": "passed",
625
- "duration": 1}}]}]}]})
626
- end
627
- end
628
-
629
- describe 'with a scenario with hooks' do
630
- define_feature <<-FEATURE
631
- Feature: Banana party
632
-
633
- Scenario: Monkey eats bananas
634
- Given there are bananas
635
- FEATURE
636
-
637
- define_steps do
638
- Before() {}
639
- Before() {}
640
- After() {}
641
- After() {}
642
- AfterStep() {}
643
- AfterStep() {}
644
- Around() { |scenario, block| block.call }
645
- Given(/^there are bananas$/) {}
646
- end
647
-
648
- it 'includes all hooks except the around hook in the json data' do
649
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
650
- [{"id": "banana-party",
651
- "uri": "spec.feature",
652
- "keyword": "Feature",
653
- "name": "Banana party",
654
- "line": 1,
655
- "description": "",
656
- "elements":
657
- [{"id": "banana-party;monkey-eats-bananas",
658
- "keyword": "Scenario",
659
- "name": "Monkey eats bananas",
660
- "line": 3,
661
- "description": "",
662
- "type": "scenario",
663
- "before":
664
- [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:638"},
665
- "result": {"status": "passed",
666
- "duration": 1}},
667
- {"match": {"location": "spec/cucumber/formatter/json_spec.rb:639"},
668
- "result": {"status": "passed",
669
- "duration": 1}}],
670
- "steps":
671
- [{"keyword": "Given ",
672
- "name": "there are bananas",
673
- "line": 4,
674
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:645"},
675
- "result": {"status": "passed",
676
- "duration": 1},
677
- "after":
678
- [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:642"},
679
- "result": {"status": "passed",
680
- "duration": 1}},
681
- {"match": {"location": "spec/cucumber/formatter/json_spec.rb:643"},
682
- "result": {"status": "passed",
683
- "duration": 1}}]}],
684
- "after":
685
- [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:641"},
686
- "result": {"status": "passed",
687
- "duration": 1}},
688
- {"match": {"location": "spec/cucumber/formatter/json_spec.rb:640"},
689
- "result": {"status": "passed",
690
- "duration": 1}}]}]}]})
691
- end
692
- end
693
-
694
- describe 'with a scenario when only an around hook is failing' do
695
- define_feature <<-FEATURE
696
- Feature: Banana party
697
-
698
- Scenario: Monkey eats bananas
699
- Given there are bananas
700
- FEATURE
701
-
702
- define_steps do
703
- Around() { |scenario, block| block.call; raise RuntimeError, 'error' }
704
- Given(/^there are bananas$/) {}
705
- end
706
-
707
- it 'includes the around hook result in the json data' do
708
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
709
- [{"id": "banana-party",
710
- "uri": "spec.feature",
711
- "keyword": "Feature",
712
- "name": "Banana party",
713
- "line": 1,
714
- "description": "",
715
- "elements":
716
- [{"id": "banana-party;monkey-eats-bananas",
717
- "keyword": "Scenario",
718
- "name": "Monkey eats bananas",
719
- "line": 3,
720
- "description": "",
721
- "type": "scenario",
722
- "steps":
723
- [{"keyword": "Given ",
724
- "name": "there are bananas",
725
- "line": 4,
726
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:704"},
727
- "result": {"status": "passed",
728
- "duration": 1}}],
729
- "around":
730
- [{"match": {"location": "unknown_hook_location:1"},
731
- "result": {"status": "failed",
732
- "error_message": "error (RuntimeError)\\n./spec/cucumber/formatter/json_spec.rb:703:in `Around'",
733
- "duration": 1}}]}]}]})
734
- end
735
- end
736
-
737
- describe 'with a scenario with a step with a data table' do
738
- define_feature <<-FEATURE
739
- Feature: Banana party
740
-
741
- Scenario: Monkey eats bananas
742
- Given there are bananas
743
- | aa | bb |
744
- | cc | dd |
745
- FEATURE
746
-
747
- define_steps do
748
- Given(/^there are bananas$/) { |s| s }
749
- end
750
-
751
- it 'includes the doc string in the json data' do
752
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
753
- [{"id": "banana-party",
754
- "uri": "spec.feature",
755
- "keyword": "Feature",
756
- "name": "Banana party",
757
- "line": 1,
758
- "description": "",
759
- "elements":
760
- [{"id": "banana-party;monkey-eats-bananas",
761
- "keyword": "Scenario",
762
- "name": "Monkey eats bananas",
763
- "line": 3,
764
- "description": "",
765
- "type": "scenario",
766
- "steps":
767
- [{"keyword": "Given ",
768
- "name": "there are bananas",
769
- "line": 4,
770
- "rows":
771
- [{"cells": ["aa", "bb"]},
772
- {"cells": ["cc", "dd"]}],
773
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:748"},
774
- "result": {"status": "passed",
775
- "duration": 1}}]}]}]})
776
- end
777
- end
778
- end
779
-
780
- def load_normalised_json(out)
781
- normalise_json(MultiJson.load(out.string))
782
- end
783
-
784
- def normalise_json(json)
785
- #make sure duration was captured (should be >= 0)
786
- #then set it to what is "expected" since duration is dynamic
787
- json.each do |feature|
788
- elements = feature.fetch('elements') { [] }
789
- elements.each do |scenario|
790
- %w(steps before after around).each do |type|
791
- if scenario[type]
792
- scenario[type].each do |step_or_hook|
793
- normalise_json_step_or_hook(step_or_hook)
794
- if step_or_hook['after']
795
- step_or_hook['after'].each do |hook|
796
- normalise_json_step_or_hook(hook)
797
- end
798
- end
799
- end
800
- end
801
- end
802
- end
803
- end
804
- end
805
-
806
- def normalise_json_step_or_hook(step_or_hook)
807
- return unless step_or_hook['result'] && step_or_hook['result']['duration']
808
-
809
- expect(step_or_hook['result']['duration']).to be >= 0
810
- step_or_hook['result']['duration'] = 1
811
- end
812
-
813
- end
814
- end
815
- end