cucumber-rails 1.6.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. checksums.yaml +5 -5
  2. data/Appraisals +18 -88
  3. data/CHANGELOG.md +208 -14
  4. data/CONTRIBUTING.md +27 -24
  5. data/Gemfile +2 -4
  6. data/LICENSE +1 -1
  7. data/README.md +45 -31
  8. data/Rakefile +17 -13
  9. data/bin/install_geckodriver.sh +19 -0
  10. data/bin/install_webpacker.sh +9 -0
  11. data/config/cucumber.yml +0 -3
  12. data/cucumber-rails.gemspec +40 -33
  13. data/dev_tasks/cucumber.rake +2 -0
  14. data/dev_tasks/rspec.rake +2 -0
  15. data/dev_tasks/yard.rake +7 -14
  16. data/dev_tasks/yard/default/layout/html/setup.rb +6 -1
  17. data/features/allow_rescue.feature +16 -11
  18. data/features/annotations.feature +8 -11
  19. data/features/capybara_javascript_drivers.feature +90 -31
  20. data/features/choose_javascript_database_strategy.feature +36 -56
  21. data/features/configuration.feature +48 -0
  22. data/features/database_cleaner.feature +103 -16
  23. data/features/disable_automatic_database_cleaning.feature +10 -16
  24. data/features/emulate_javascript.feature +59 -44
  25. data/features/install_cucumber_rails.feature +4 -4
  26. data/features/no_database.feature +6 -6
  27. data/features/raising_errors.feature +9 -3
  28. data/features/rerun_profile.feature +5 -4
  29. data/features/rest_api.feature +11 -11
  30. data/features/step_definitions/cucumber_rails_steps.rb +43 -100
  31. data/features/support/aruba.rb +3 -1
  32. data/features/support/cucumber_rails_helper.rb +86 -0
  33. data/features/support/env.rb +4 -38
  34. data/features/support/hooks.rb +8 -0
  35. data/gemfiles/rails_5_0.gemfile +4 -12
  36. data/gemfiles/rails_5_1.gemfile +3 -10
  37. data/gemfiles/rails_5_2.gemfile +2 -10
  38. data/gemfiles/rails_6_0.gemfile +8 -0
  39. data/lib/cucumber/rails.rb +23 -17
  40. data/lib/cucumber/rails/action_dispatch.rb +21 -0
  41. data/lib/cucumber/rails/application.rb +16 -7
  42. data/lib/cucumber/rails/capybara.rb +2 -0
  43. data/lib/cucumber/rails/capybara/javascript_emulation.rb +43 -35
  44. data/lib/cucumber/rails/capybara/select_dates_and_times.rb +3 -1
  45. data/lib/cucumber/rails/database.rb +24 -56
  46. data/lib/cucumber/rails/database/deletion_strategy.rb +11 -0
  47. data/lib/cucumber/rails/database/shared_connection_strategy.rb +25 -0
  48. data/lib/cucumber/rails/database/strategy.rb +31 -0
  49. data/lib/cucumber/rails/database/truncation_strategy.rb +11 -0
  50. data/lib/cucumber/rails/hooks.rb +2 -0
  51. data/lib/cucumber/rails/hooks/active_record.rb +8 -4
  52. data/lib/cucumber/rails/hooks/allow_rescue.rb +2 -0
  53. data/lib/cucumber/rails/hooks/database_cleaner.rb +11 -3
  54. data/lib/cucumber/rails/hooks/mail.rb +3 -1
  55. data/lib/cucumber/rails/rspec.rb +3 -1
  56. data/lib/cucumber/rails/world.rb +24 -7
  57. data/lib/generators/cucumber/{install/USAGE → USAGE} +0 -0
  58. data/lib/generators/cucumber/{install/install_generator.rb → install_generator.rb} +23 -10
  59. data/lib/generators/cucumber/{install/templates → templates}/config/cucumber.yml.erb +0 -0
  60. data/lib/generators/cucumber/{install/templates → templates}/script/cucumber +1 -0
  61. data/lib/generators/cucumber/{install/templates → templates}/support/_rails_each_run.rb.erb +0 -0
  62. data/lib/generators/cucumber/{install/templates → templates}/support/_rails_prefork.rb.erb +0 -0
  63. data/lib/generators/cucumber/{install/templates → templates}/support/capybara.rb +2 -0
  64. data/lib/generators/cucumber/{install/templates → templates}/support/edit_warning.txt +0 -0
  65. data/lib/generators/cucumber/{install/templates → templates}/support/rails.rb.erb +0 -0
  66. data/lib/generators/cucumber/{install/templates → templates}/support/rails_spork.rb.erb +0 -0
  67. data/lib/generators/cucumber/{install/templates → templates}/tasks/cucumber.rake.erb +0 -0
  68. data/spec/cucumber/rails/database_spec.rb +50 -33
  69. data/spec/examples.txt +19 -0
  70. data/spec/generators/cucumber/{install/install_generator_spec.rb → install_generator_spec.rb} +16 -8
  71. data/spec/spec_helper.rb +4 -2
  72. data/tmp/aruba/test_app/Gemfile +62 -0
  73. data/tmp/aruba/test_app/Gemfile.lock +249 -0
  74. data/tmp/aruba/test_app/README.md +24 -0
  75. data/tmp/aruba/test_app/Rakefile +6 -0
  76. data/tmp/aruba/test_app/app/assets/config/manifest.js +3 -0
  77. data/tmp/aruba/test_app/app/assets/javascripts/application.js +16 -0
  78. data/tmp/aruba/test_app/app/assets/javascripts/appointments.coffee +3 -0
  79. data/tmp/aruba/test_app/app/assets/javascripts/cable.js +13 -0
  80. data/tmp/aruba/test_app/app/assets/stylesheets/application.css +15 -0
  81. data/tmp/aruba/test_app/app/assets/stylesheets/appointments.scss +3 -0
  82. data/tmp/aruba/test_app/app/assets/stylesheets/scaffolds.scss +84 -0
  83. data/tmp/aruba/test_app/app/channels/application_cable/channel.rb +4 -0
  84. data/tmp/aruba/test_app/app/channels/application_cable/connection.rb +4 -0
  85. data/tmp/aruba/test_app/app/controllers/application_controller.rb +2 -0
  86. data/tmp/aruba/test_app/app/controllers/appointments_controller.rb +74 -0
  87. data/tmp/aruba/test_app/app/helpers/application_helper.rb +2 -0
  88. data/tmp/aruba/test_app/app/helpers/appointments_helper.rb +2 -0
  89. data/tmp/aruba/test_app/app/jobs/application_job.rb +2 -0
  90. data/tmp/aruba/test_app/app/mailers/application_mailer.rb +4 -0
  91. data/tmp/aruba/test_app/app/models/application_record.rb +3 -0
  92. data/tmp/aruba/test_app/app/models/appointment.rb +2 -0
  93. data/tmp/aruba/test_app/app/views/appointments/_appointment.json.jbuilder +2 -0
  94. data/tmp/aruba/test_app/app/views/appointments/_form.html.erb +27 -0
  95. data/tmp/aruba/test_app/app/views/appointments/edit.html.erb +6 -0
  96. data/tmp/aruba/test_app/app/views/appointments/index.html.erb +29 -0
  97. data/tmp/aruba/test_app/app/views/appointments/index.json.jbuilder +1 -0
  98. data/tmp/aruba/test_app/app/views/appointments/new.html.erb +5 -0
  99. data/tmp/aruba/test_app/app/views/appointments/show.html.erb +14 -0
  100. data/tmp/aruba/test_app/app/views/appointments/show.json.jbuilder +1 -0
  101. data/tmp/aruba/test_app/app/views/layouts/application.html.erb +15 -0
  102. data/tmp/aruba/test_app/app/views/layouts/mailer.html.erb +13 -0
  103. data/tmp/aruba/test_app/app/views/layouts/mailer.text.erb +1 -0
  104. data/tmp/aruba/test_app/bin/bundle +3 -0
  105. data/tmp/aruba/test_app/bin/rails +4 -0
  106. data/tmp/aruba/test_app/bin/rake +4 -0
  107. data/tmp/aruba/test_app/bin/setup +36 -0
  108. data/tmp/aruba/test_app/bin/update +31 -0
  109. data/tmp/aruba/test_app/bin/yarn +11 -0
  110. data/tmp/aruba/test_app/config.ru +5 -0
  111. data/tmp/aruba/test_app/config/application.rb +19 -0
  112. data/tmp/aruba/test_app/config/boot.rb +3 -0
  113. data/tmp/aruba/test_app/config/cable.yml +10 -0
  114. data/tmp/aruba/test_app/config/credentials.yml.enc +1 -0
  115. data/tmp/aruba/test_app/config/cucumber.yml +9 -0
  116. data/tmp/aruba/test_app/config/database.yml +25 -0
  117. data/tmp/aruba/test_app/config/environment.rb +5 -0
  118. data/tmp/aruba/test_app/config/environments/development.rb +61 -0
  119. data/tmp/aruba/test_app/config/environments/production.rb +94 -0
  120. data/tmp/aruba/test_app/config/environments/test.rb +46 -0
  121. data/tmp/aruba/test_app/config/initializers/application_controller_renderer.rb +8 -0
  122. data/tmp/aruba/test_app/config/initializers/assets.rb +14 -0
  123. data/tmp/aruba/test_app/config/initializers/backtrace_silencers.rb +7 -0
  124. data/tmp/aruba/test_app/config/initializers/content_security_policy.rb +25 -0
  125. data/tmp/aruba/test_app/config/initializers/cookies_serializer.rb +5 -0
  126. data/tmp/aruba/test_app/config/initializers/filter_parameter_logging.rb +4 -0
  127. data/tmp/aruba/test_app/config/initializers/inflections.rb +16 -0
  128. data/tmp/aruba/test_app/config/initializers/mime_types.rb +4 -0
  129. data/tmp/aruba/test_app/config/initializers/wrap_parameters.rb +14 -0
  130. data/tmp/aruba/test_app/config/locales/en.yml +33 -0
  131. data/tmp/aruba/test_app/config/master.key +1 -0
  132. data/tmp/aruba/test_app/config/puma.rb +37 -0
  133. data/tmp/aruba/test_app/config/routes.rb +4 -0
  134. data/tmp/aruba/test_app/config/storage.yml +34 -0
  135. data/tmp/aruba/test_app/db/development.sqlite3 +0 -0
  136. data/tmp/aruba/test_app/db/migrate/20200821080656_create_appointments.rb +10 -0
  137. data/tmp/aruba/test_app/db/schema.rb +22 -0
  138. data/tmp/aruba/test_app/db/seeds.rb +7 -0
  139. data/tmp/aruba/test_app/db/test.sqlite3 +0 -0
  140. data/tmp/aruba/test_app/features/create_appointment.feature +9 -0
  141. data/tmp/aruba/test_app/features/create_appointment_steps.rb +19 -0
  142. data/tmp/aruba/test_app/features/support/env.rb +18 -0
  143. data/tmp/aruba/test_app/lib/tasks/cucumber.rake +76 -0
  144. data/tmp/aruba/test_app/log/development.log +27 -0
  145. data/tmp/aruba/test_app/log/test.log +38 -0
  146. data/tmp/aruba/test_app/package.json +5 -0
  147. data/tmp/aruba/test_app/public/404.html +67 -0
  148. data/tmp/aruba/test_app/public/422.html +67 -0
  149. data/tmp/aruba/test_app/public/500.html +66 -0
  150. data/tmp/aruba/test_app/public/apple-touch-icon-precomposed.png +0 -0
  151. data/tmp/aruba/test_app/public/apple-touch-icon.png +0 -0
  152. data/tmp/aruba/test_app/public/favicon.ico +0 -0
  153. data/tmp/aruba/test_app/public/robots.txt +1 -0
  154. data/tmp/aruba/test_app/script/cucumber +11 -0
  155. data/tmp/aruba/test_app/test/application_system_test_case.rb +5 -0
  156. data/tmp/aruba/test_app/test/controllers/appointments_controller_test.rb +48 -0
  157. data/tmp/aruba/test_app/test/fixtures/appointments.yml +9 -0
  158. data/tmp/aruba/test_app/test/models/appointment_test.rb +7 -0
  159. data/tmp/aruba/test_app/test/system/appointments_test.rb +45 -0
  160. data/tmp/aruba/test_app/test/test_helper.rb +10 -0
  161. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/0I/0I0oT83oN3NKiEi9XIhexiT3XgkA8mKyCbs25v3l20g.cache +1 -0
  162. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/0W/0WnFNEwHN4bhDiFTvyMWURx02L4yP3gkP7vtjzKQFVo.cache +1 -0
  163. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/2B/2Bg65dpvTdePrXa_wG6RsHpQzbqVSiHK0FVa0WdOJ4k.cache +0 -0
  164. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/2r/2r_85kVmIcWzvJH72GapWtLDhaMP2HEziNxykyYpAUg.cache +1 -0
  165. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/72/72jdZDzrM3-D_zYkIiPdAWQNeaFsqah154_QvcqWqTQ.cache +3 -0
  166. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/99/99m8UCKl4j8IpsVOK8ltLHyNh8Ae0nHw3GBkC34V_co.cache +2 -0
  167. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/9O/9OOXnKHBQnaCeE5HDe5csQsItouzWM6rTl8sESvkGTE.cache +1 -0
  168. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/AF/AFloQwm_M7GZudPY87xx4TA0xEeuX9Psl0SJ94i5EyU.cache +3 -0
  169. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/AP/APDAc8aUg_16wNWrVhCJcKeqbxyOScYGVhiDVgbrV7U.cache +0 -0
  170. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/B4/B43LeT9Wba4fLvXw-C_kKq-x9HwYZxnBBiltbIufzzQ.cache +2 -0
  171. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/EO/EOut5kyDPr7aKrHdvDsNJuYarA8XGnpAlDvBimlaC08.cache +0 -0
  172. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/GJ/GJzxuc2i_d4Uhxs4IMnbQXhxBc9CTLrnQyzxwTqKOBw.cache +0 -0
  173. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Ge/Ge2oyaUStbQszLfXjgTi6LkncyS5SKfV8RJwbRA3HbI.cache +1 -0
  174. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/HC/HCDOUd7-S45aJ_PjVAC_Vmjyud3i1aQv4cE3t9_Z3Dw.cache +2 -0
  175. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Hv/HvPd_vK17QbhWq8QnCuyhqm0cPaGnHyO9lSzN-icQdg.cache +2 -0
  176. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/II/IIhUO-5-DcfCyD_rVJeHjRMNVJxLmAmXP8i2XEjFpns.cache +1 -0
  177. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Ka/KaLHRsUYc4EUxUr4q_UhArFJUTF_EaBklpeU4TsE9SY.cache +1 -0
  178. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/MZ/MZcwDENEs93Wd9q7A_7UWdfJrWsBXa0pGp03P9mqG2I.cache +3 -0
  179. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Nw/NwHea3ImBECnlmojPb9X9ZDfvRRuX_dX9sxISdtp9-A.cache +0 -0
  180. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/PP/PPKuKT7m2PMDHVzBcYjePvXU6CbCW63Iqe3Q2a-Jdh8.cache +1 -0
  181. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/RE/REtgGrS74n4Y7OKRcGvZsA2EUClg_RM66mVgGpySI20.cache +1 -0
  182. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Rk/RkQLRXSz5LhJQnH7BT-ZDkVK0Rx8N9KhcVwR2A1HY4M.cache +2 -0
  183. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Sx/SxtNEQ-KKVBCTtsDD-xf4oJEIdBPIHkGktnLXvG-GRk.cache +1 -0
  184. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/TL/TLxLzqEAxKzTHH9EwSg5Lvcp3zgGuhjTjed121DSu9U.cache +0 -0
  185. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/U1/U1D7nCXYBD3VlPnXGs_6mRtlhs-Gvv_vvCUYlTf4Grw.cache +3 -0
  186. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/U6/U6pXyI-5haNcHRdsB-SoztzlXb98-256hFReXsL31J4.cache +2 -0
  187. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/UE/UEKUaC9O_XBO5acP8HnxcJ1dtNM_1C7MTofkTQvPgRA.cache +1 -0
  188. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/UV/UVcnI5bo-eQvULfmzeQUFVTDYEMF2cbAXpsOsh01XNY.cache +1 -0
  189. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/WK/WK8RpMP5qb9GRQTsTHAzlfo8t2nsTLU6B8CQAc4UfOU.cache +1 -0
  190. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Xk/Xk8p9O39-syzKbpnoMRChld0TpoZFWlNIzeT5XKw2fQ.cache +0 -0
  191. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Zv/ZvCEW2ZyS-k4cHH7Gd8P2nKFE9Uh1VOrfR-1PYY2yz8.cache +5 -0
  192. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/ac/acWu1-1ZAW1jRVKlHYlzlEg28lk-SdHfTq-P-viJMS0.cache +1 -0
  193. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/b3/b3NiYrQOlN2zxiJYqbl4gmvK6it3Md9gSzAYgsIMhnY.cache +1 -0
  194. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/c1/c1Pm-rFPEB3LXIjOtswD6x8SEAgI9y2BR16jc8ifcsc.cache +1 -0
  195. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/em/emTQG2a9zF8NuvElLOnEpNJp0wq3_gVSDAM60vyXAzE.cache +0 -0
  196. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/fX/fXH3Db_88TmJFhRydoFTx8tZbHAkLzK2ZZ0lsBEg8xA.cache +0 -0
  197. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/gI/gIHntmCf7DbObPL_KZJYSgduAmqX18ZZPOtq85pn8vo.cache +0 -0
  198. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/kP/kPwbLAUCLjv0x6fe5lvZpmUkgmvQSDHSdEOSdbMyDgY.cache +0 -0
  199. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/kT/kT98Z_slHI6SgdEmoAtKAHyJQjTHdbe6GAbB27RP2uI.cache +1 -0
  200. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/mt/mtT4Rwi7H_vHQXdxxPvvzhL4ziA7X9WK-JXzacxWlEA.cache +0 -0
  201. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/mz/mzgD6X_N-fO95dP8Q1Q1sApCrbSmgPgsuEKv65KYcdo.cache +3 -0
  202. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/oi/oiPhXw8pYdWv5T4qRFzePHaXZLI50xMvvTyfry-ILSo.cache +1 -0
  203. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/r-/r--YB1ugrZ4F-ogbLLYNwIH3j9pQ2u_ZBjTJxoS7TrM.cache +1 -0
  204. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/s6/s68UIyg0lNko7IA42JXv_wwy9Ea3WH-zc9h0GYPg88Y.cache +1 -0
  205. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/si/siT97rfEKbIWcCj6KUBChX7kpRBKI2fAeGGwpsz0tTU.cache +0 -0
  206. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/st/stqDgDfAemfEq7ZxlEj6YThpn8_1Nfw2bRVA0N03YTw.cache +1 -0
  207. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/t9/t93lpjyly3MvgKs51_OlLXneJXGyYFGmshXsk4Wr69M.cache +1 -0
  208. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/tE/tEy2QePsDnmFyyAQEric23sSBnfHBst3SEM7p-J7el8.cache +2 -0
  209. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/tR/tRV7SyAY9c71G0o-8bElvNI76KcWhc5NVm48xflMPpM.cache +0 -0
  210. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/tg/tggwa2O6A41xeZTK4SR0qcX0X55aOGg6q8ZWfqma1vM.cache +0 -0
  211. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/uB/uBKOYcdzL_6Amevsu-uKAMTg7QGW5kgC0t5sAZINrcI.cache +0 -0
  212. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/uE/uEyPXY2m04nerJV0pn3p-B-BlkJ08oufpQH1G2QXPw4.cache +1 -0
  213. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/up/upyndqsU9bU6WV8qyMy7MLpcQoybRqgj-qA3C3pjzXY.cache +0 -0
  214. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/ux/uxx-W2TOCdnAEGX0ZLThb_QIEbLYutX8qCwD0glYCKE.cache +3 -0
  215. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/vC/vCsc-q2WmT8vWM2d2pb6_5hFav8mGlylwEKVWQvsumo.cache +1 -0
  216. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/vc/vcgiILg1wO98x-a4kX678ASAFWA1cL0iVx07VkHLPqA.cache +0 -0
  217. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/vu/vu6xNIGT6zorPmcKfd7edgxBltTmIRXU281uyK51kkU.cache +1 -0
  218. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/w4/w4y_Lms54hD2Nivh5PHeccAmh2DX53sc_HDTQYNyNXw.cache +3 -0
  219. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/yZ/yZpoD5Zf4RAQoOwi5kMVksuta_0KhYSK_Yy_6Ykyt7E.cache +1 -0
  220. data/tmp/aruba/test_app/tmp/development_secret.txt +1 -0
  221. metadata +262 -158
  222. data/.github/ISSUE_TEMPLATE.md +0 -52
  223. data/.github/PULL_REQUEST_TEMPLATE.md +0 -42
  224. data/.gitignore +0 -12
  225. data/.rspec +0 -1
  226. data/.travis.yml +0 -43
  227. data/Gemfile.appraisal +0 -3
  228. data/config/.gitignore +0 -1
  229. data/features/support/bundler_pre_support.rb +0 -28
  230. data/features/support/fixtures/bundler-1.0.21.gem +0 -0
  231. data/features/support/fixtures/bundler-1.1.rc.gem +0 -0
  232. data/features/support/legacy_web_steps_support.rb +0 -289
  233. data/gemfiles/rails_4_0.gemfile +0 -22
  234. data/gemfiles/rails_4_1.gemfile +0 -20
  235. data/gemfiles/rails_4_2.gemfile +0 -19
  236. data/lib/cucumber/rails/action_controller.rb +0 -12
@@ -0,0 +1,11 @@
1
+ module Cucumber
2
+ module Rails
3
+ module Database
4
+ class TruncationStrategy < Strategy
5
+ def before_js
6
+ super :truncation
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cucumber/rails/hooks/active_record'
2
4
  require 'cucumber/rails/hooks/database_cleaner'
3
5
  require 'cucumber/rails/hooks/allow_rescue'
@@ -1,9 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  if defined?(ActiveRecord::Base)
2
- class ActiveRecord::Base
3
- class_attribute :shared_connection
4
+ module ActiveRecord
5
+ class Base
6
+ class_attribute :shared_connection
4
7
 
5
- def self.connection
6
- self.shared_connection || retrieve_connection
8
+ def self.connection
9
+ shared_connection || retrieve_connection
10
+ end
7
11
  end
8
12
  end
9
13
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Before('@allow-rescue') do
2
4
  @__orig_allow_rescue = ActionController::Base.allow_rescue
3
5
  ActionController::Base.allow_rescue = true
@@ -1,6 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
- require 'database_cleaner'
4
+ require 'database_cleaner/core'
5
+ rescue LoadError
6
+ begin
7
+ require 'database_cleaner'
8
+ rescue LoadError
9
+ Cucumber.logger.debug('neither database_cleaner v1 or v2 present')
10
+ end
11
+ end
3
12
 
13
+ if defined?(DatabaseCleaner)
4
14
  Before('not @no-database-cleaner') do
5
15
  DatabaseCleaner.start if Cucumber::Rails::Database.autorun_database_cleaner
6
16
  end
@@ -8,6 +18,4 @@ begin
8
18
  After('not @no-database-cleaner') do
9
19
  DatabaseCleaner.clean if Cucumber::Rails::Database.autorun_database_cleaner
10
20
  end
11
-
12
- rescue LoadError => ignore_if_database_cleaner_not_present
13
21
  end
@@ -1,4 +1,6 @@
1
- if defined?(ActionMailer::Base)
1
+ # frozen_string_literal: true
2
+
3
+ if defined?(::ActionMailer)
2
4
  Before do
3
5
  ActionMailer::Base.deliveries = []
4
6
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cucumber/rails/world'
2
4
 
3
5
  begin
@@ -8,7 +10,7 @@ begin
8
10
  include RSpec::Matchers
9
11
  end
10
12
  end
11
- rescue LoadError => try_rspec_1
13
+ rescue LoadError
12
14
  require 'spec/expectations'
13
15
  require 'spec/rails'
14
16
 
@@ -1,21 +1,38 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  # Try to load it so we can assign @_result below if needed.
3
5
  require 'test/unit/testresult'
4
- rescue LoadError => ignore
6
+ rescue LoadError
7
+ Cucumber.logger.debug('Minitest not found.')
8
+ end
9
+
10
+ module Cucumber
11
+ module Rails
12
+ class << self
13
+ def include_rack_test_helpers?
14
+ # Using ActiveModel Boolean casting here will give false positives more often than not!
15
+ !ENV['CR_REMOVE_RACK_TEST_HELPERS']&.casecmp('true')&.zero?
16
+ end
17
+ end
18
+ end
5
19
  end
6
20
 
7
- module Cucumber #:nodoc:
8
- module Rails #:nodoc:
9
- class World < ActionDispatch::IntegrationTest #:nodoc:
10
- include Rack::Test::Methods
21
+ module Cucumber
22
+ module Rails
23
+ class World < ::ActionDispatch::IntegrationTest
24
+ include Rack::Test::Methods if Cucumber::Rails.include_rack_test_helpers?
11
25
  include ActiveSupport::Testing::SetupAndTeardown if ActiveSupport::Testing.const_defined?('SetupAndTeardown')
12
26
 
13
- def initialize #:nodoc:
27
+ def initialize
14
28
  @_result = Test::Unit::TestResult.new if defined?(Test::Unit::TestResult)
15
29
  end
16
30
 
17
31
  unless defined?(ActiveRecord::Base)
18
- def self.fixture_table_names; []; end # Workaround for projects that don't use ActiveRecord
32
+ # Workaround for projects that don't use ActiveRecord
33
+ def self.fixture_table_names
34
+ []
35
+ end
19
36
  end
20
37
  end
21
38
  end
@@ -1,13 +1,22 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbconfig'
2
4
 
3
5
  module Cucumber
4
6
  class InstallGenerator < ::Rails::Generators::Base
5
- source_root File.expand_path('../templates', __FILE__)
7
+ source_root File.expand_path('templates', __dir__)
6
8
 
7
9
  DEFAULT_SHEBANG = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
8
10
 
9
- class_option :spork, type: :boolean, desc: 'Use Spork'
10
- class_option :skip_database, type: :boolean, desc: 'Skip modification of database.yml', aliases: '-D', default: false
11
+ class_option :spork,
12
+ type: :boolean,
13
+ desc: 'Use Spork'
14
+
15
+ class_option :skip_database,
16
+ type: :boolean,
17
+ desc: 'Skip modification of database.yml',
18
+ aliases: '-D',
19
+ default: false
11
20
 
12
21
  def create_templates
13
22
  template 'config/cucumber.yml.erb', 'config/cucumber.yml'
@@ -39,13 +48,13 @@ module Cucumber
39
48
 
40
49
  def create_database
41
50
  return unless File.exist?('config/database.yml')
42
- unless File.read('config/database.yml').include? 'cucumber:'
43
- gsub_file 'config/database.yml', /^test:.*\n/, "test: &test\n"
44
- gsub_file 'config/database.yml', /\z/, "\ncucumber:\n <<: *test\n"
51
+ return unless File.read('config/database.yml').include? 'cucumber:'
45
52
 
46
- # Since gsub_file doesn't ask the user, just inform user that the file was overwritten.
47
- puts ' force config/database.yml'
48
- end
53
+ gsub_file 'config/database.yml', /^test:.*\n/, "test: &test\n"
54
+ gsub_file 'config/database.yml', /\z/, "\ncucumber:\n <<: *test\n"
55
+
56
+ # Since gsub_file doesn't ask the user, just inform user that the file was overwritten.
57
+ puts ' force config/database.yml'
49
58
  end
50
59
 
51
60
  protected
@@ -60,7 +69,11 @@ module Cucumber
60
69
 
61
70
  def embed_template(source, indent = '')
62
71
  template = File.join(self.class.source_root, source)
63
- ERB.new(IO.read(template), nil, '-').result(binding).gsub(/^/, indent)
72
+ if RUBY_VERSION >= '2.6'
73
+ ERB.new(IO.read(template), trim_mode: '-').result(binding).gsub(/^/, indent)
74
+ else
75
+ ERB.new(IO.read(template), nil, '-').result(binding).gsub(/^/, indent)
76
+ end
64
77
  end
65
78
  end
66
79
  end
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
4
5
  if vendored_cucumber_bin
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Capybara defaults to CSS3 selectors rather than XPath.
2
4
  # If you'd prefer to use XPath, just uncomment this line and adjust any
3
5
  # selectors in your step definitions to use the XPath syntax.
@@ -1,57 +1,74 @@
1
- # -*- encoding: utf-8 -*-
1
+ # frozen_string_literal: true
2
+
3
+ require 'cucumber/rails/database/strategy'
4
+ require 'cucumber/rails/database/deletion_strategy'
5
+ require 'cucumber/rails/database/shared_connection_strategy'
6
+ require 'cucumber/rails/database/truncation_strategy'
2
7
  require 'cucumber/rails/database'
3
8
 
4
9
  describe Cucumber::Rails::Database do
10
+ before { allow(strategy_type).to receive(:new).and_return(strategy) }
11
+
12
+ let(:strategy) { instance_double(strategy_type, before_js: nil, before_non_js: nil) }
13
+ let(:strategy_type) { Cucumber::Rails::Database::TruncationStrategy }
5
14
 
6
- let(:strategy) { double(before_js: nil, before_non_js: nil) }
15
+ context 'when using a valid pre-determined strategy' do
16
+ before { described_class.javascript_strategy = :truncation }
7
17
 
8
- it 'forwards events to the selected strategy' do
9
- allow(Cucumber::Rails::Database::TruncationStrategy).to receive_messages(new: strategy)
10
- Cucumber::Rails::Database.javascript_strategy = :truncation
18
+ it 'forwards a `before_non_js` event to the selected strategy' do
19
+ expect(strategy).to receive(:before_non_js)
20
+
21
+ described_class.before_non_js
22
+ end
11
23
 
12
- expect(strategy).to receive(:before_non_js).ordered
13
- Cucumber::Rails::Database.before_non_js
24
+ it 'forwards a `before_js` event to the selected strategy' do
25
+ expect(strategy).to receive(:before_js)
14
26
 
15
- expect(strategy).to receive(:before_js).ordered
16
- Cucumber::Rails::Database.before_js
27
+ described_class.before_js
28
+ end
17
29
  end
18
30
 
19
- it 'raises an error if you use a non-understood strategy' do
20
- expect { Cucumber::Rails::Database.javascript_strategy = :invalid }.to raise_error(Cucumber::Rails::Database::InvalidStrategy)
31
+ context 'when using an invalid pre-determined strategy' do
32
+ it 'raises an error if you use a non-understood strategy' do
33
+ expect { described_class.javascript_strategy = :invalid }
34
+ .to raise_error(Cucumber::Rails::Database::InvalidStrategy)
35
+ end
21
36
  end
22
37
 
23
- describe 'using a custom strategy' do
24
- class ValidStrategy
25
- def before_js
26
- # Anything
27
- end
38
+ context 'when using a valid custom strategy' do
39
+ before { described_class.javascript_strategy = strategy_type }
28
40
 
29
- def before_non_js
30
- # Likewise
41
+ let(:strategy_type) do
42
+ Class.new do
43
+ def before_js
44
+ # Anything
45
+ end
46
+
47
+ def before_non_js
48
+ # Likewise
49
+ end
31
50
  end
32
51
  end
33
52
 
34
- class InvalidStrategy
35
- end
53
+ it 'forwards a `before_non_js` event to the strategy' do
54
+ expect(strategy).to receive(:before_non_js)
36
55
 
37
- it 'raises an error if the strategy doens\'t support the protocol' do
38
- expect { Cucumber::Rails::Database.javascript_strategy = InvalidStrategy }.to raise_error(ArgumentError)
56
+ described_class.before_non_js
39
57
  end
40
58
 
41
- it 'accepts a custom strategy with a valid interface' do
42
- expect { Cucumber::Rails::Database.javascript_strategy = ValidStrategy }.not_to raise_error
43
- end
59
+ it 'forwards a `before_js` event to the strategy' do
60
+ expect(strategy).to receive(:before_js)
44
61
 
45
- it 'forwards events to a custom strategy' do
46
- allow(ValidStrategy).to receive_messages(new: strategy)
47
- Cucumber::Rails::Database.javascript_strategy = ValidStrategy
62
+ described_class.before_js
63
+ end
64
+ end
48
65
 
49
- expect(strategy).to receive(:before_non_js).ordered
50
- Cucumber::Rails::Database.before_non_js
66
+ context 'when using an invalid custom strategy' do
67
+ let(:invalid_strategy) { Class.new }
51
68
 
52
- expect(strategy).to receive(:before_js).ordered
53
- Cucumber::Rails::Database.before_js
69
+ it 'raises an error if the strategy does not have a valid interface' do
70
+ expect { described_class.javascript_strategy = invalid_strategy }
71
+ .to raise_error(ArgumentError)
54
72
  end
55
73
  end
56
-
57
74
  end
@@ -0,0 +1,19 @@
1
+ example_id | status | run_time |
2
+ ------------------------------------------------------------- | ------ | --------------- |
3
+ ./spec/cucumber/rails/database_spec.rb[1:1:1] | passed | 0.00057 seconds |
4
+ ./spec/cucumber/rails/database_spec.rb[1:1:2] | passed | 0.00845 seconds |
5
+ ./spec/cucumber/rails/database_spec.rb[1:2:1] | passed | 0.00046 seconds |
6
+ ./spec/cucumber/rails/database_spec.rb[1:3:1] | passed | 0.00683 seconds |
7
+ ./spec/cucumber/rails/database_spec.rb[1:3:2] | passed | 0.00494 seconds |
8
+ ./spec/cucumber/rails/database_spec.rb[1:4:1] | passed | 0.69664 seconds |
9
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:1:1] | passed | 0.0271 seconds |
10
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:1:2] | passed | 0.0285 seconds |
11
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:2:1] | passed | 0.05333 seconds |
12
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:3:1] | passed | 0.02378 seconds |
13
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:3:2] | passed | 0.04247 seconds |
14
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:3:3] | passed | 0.05091 seconds |
15
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:4:1] | passed | 0.04202 seconds |
16
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:4:2] | passed | 0.04029 seconds |
17
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:4:3] | passed | 0.01359 seconds |
18
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:5:1] | passed | 0.04387 seconds |
19
+ ./spec/generators/cucumber/install_generator_spec.rb[1:1:5:2] | passed | 0.03496 seconds |
@@ -1,47 +1,55 @@
1
- require 'spec_helper'
1
+ # frozen_string_literal: true
2
2
 
3
3
  # Generators are not automatically loaded by Rails
4
- require 'generators/cucumber/install/install_generator'
4
+ require 'generators/cucumber/install_generator'
5
5
 
6
6
  describe Cucumber::InstallGenerator do
7
7
  # Tell the generator where to put its output (what it thinks of as Rails.root)
8
- destination File.expand_path('../../../../../tmp', __FILE__)
8
+ destination File.expand_path('../../../../tmp', __dir__)
9
9
 
10
10
  before { prepare_destination }
11
11
 
12
- describe 'no arguments' do
13
- before { run_generator }
12
+ let(:auto_generated_message) do
13
+ '# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.'
14
+ end
15
+
16
+ context 'without arguments' do
17
+ before { run_generator }
14
18
 
15
19
  describe 'config/cucumber.yml' do
16
20
  subject { file('config/cucumber.yml') }
21
+
17
22
  it { is_expected.to exist }
18
23
  it { is_expected.to contain 'default: <%= std_opts %> features' }
19
24
  end
20
25
 
21
26
  describe 'features/step_definitions folder' do
22
27
  subject { file('features/step_definitions') }
28
+
23
29
  it { is_expected.to exist }
24
30
  end
25
31
 
26
32
  describe 'features/support/env.rb' do
27
33
  subject { file('features/support/env.rb') }
34
+
28
35
  it { is_expected.to exist }
29
- it { is_expected.to contain '# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.' }
36
+ it { is_expected.to contain auto_generated_message }
30
37
  it { is_expected.to contain "require 'cucumber/rails'" }
31
38
  end
32
39
 
33
40
  describe 'lib/tasks/cucumber.rake' do
34
41
  subject { file('lib/tasks/cucumber.rake') }
42
+
35
43
  it { is_expected.to exist }
36
- it { is_expected.to contain '# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.' }
44
+ it { is_expected.to contain auto_generated_message }
37
45
  it { is_expected.to contain "task cucumber: 'cucumber:ok'" }
38
46
  end
39
47
 
40
48
  describe 'script/cucumber' do
41
49
  subject { file('script/cucumber') }
50
+
42
51
  it { is_expected.to exist }
43
52
  it { is_expected.to contain 'load Cucumber::BINARY' }
44
53
  end
45
-
46
54
  end
47
55
  end
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/rails/fixture_support'
2
4
  require 'rails/all'
3
5
 
4
- ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
6
+ ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
5
7
 
6
8
  module CucumberRails
7
9
  class Application < ::Rails::Application
8
- self.config.secret_key_base = 'ASecretString' if config.respond_to? :secret_key_base
10
+ config.secret_key_base = 'ASecretString'
9
11
  end
10
12
  end
11
13
 
@@ -0,0 +1,62 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ ruby '2.5.8'
5
+
6
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7
+ gem 'rails', '~> 5.2.4', '>= 5.2.4.3'
8
+ # Use sqlite3 as the database for Active Record
9
+ gem 'sqlite3', "~> 1.3.13"
10
+
11
+ # Use Puma as the app server
12
+ gem 'puma', '~> 3.11'
13
+ # Use SCSS for stylesheets
14
+ gem 'sass-rails', '~> 5.0'
15
+ # Use Uglifier as compressor for JavaScript assets
16
+ gem 'uglifier', '>= 1.3.0'
17
+ # See https://github.com/rails/execjs#readme for more supported runtimes
18
+ # gem 'mini_racer', platforms: :ruby
19
+
20
+ # Use CoffeeScript for .coffee assets and views
21
+ gem 'coffee-rails', '~> 4.2'
22
+ # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
23
+ gem 'turbolinks', '~> 5'
24
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
25
+ gem 'jbuilder', '~> 2.5'
26
+ # Use Redis adapter to run Action Cable in production
27
+ # gem 'redis', '~> 4.0'
28
+ # Use ActiveModel has_secure_password
29
+ # gem 'bcrypt', '~> 3.1.7'
30
+
31
+ # Use ActiveStorage variant
32
+ # gem 'mini_magick', '~> 4.8'
33
+
34
+ # Use Capistrano for deployment
35
+ # gem 'capistrano-rails', group: :development
36
+
37
+ group :development, :test do
38
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
39
+ gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
40
+ end
41
+
42
+ group :development do
43
+ # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
44
+ gem 'web-console', '>= 3.3.0'
45
+ gem 'listen', '>= 3.0.5', '< 3.2'
46
+ end
47
+
48
+ group :test do
49
+ # Adds support for Capybara system testing and selenium driver
50
+ gem 'capybara', group: :test
51
+
52
+ gem 'selenium-webdriver', "~> 3.11", group: :test
53
+
54
+ # Easy installation and use of chromedriver to run system tests with Chrome
55
+ gem 'chromedriver-helper'
56
+ end
57
+
58
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
59
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
60
+ gem 'cucumber-rails', group: :test, require: false, path: "/home/luke/Code/cucumber-rails"
61
+ gem 'rspec-expectations', "~> 3.7", group: :test
62
+ gem 'factory_bot', ">= 3.2", group: :test