cucumber-rails 1.7.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +197 -19
  3. data/CONTRIBUTING.md +16 -14
  4. data/LICENSE +1 -1
  5. data/README.md +27 -21
  6. data/lib/cucumber/rails.rb +23 -17
  7. data/lib/cucumber/rails/action_dispatch.rb +21 -0
  8. data/lib/cucumber/rails/application.rb +16 -7
  9. data/lib/cucumber/rails/capybara.rb +2 -0
  10. data/lib/cucumber/rails/capybara/javascript_emulation.rb +42 -21
  11. data/lib/cucumber/rails/capybara/select_dates_and_times.rb +3 -1
  12. data/lib/cucumber/rails/database.rb +24 -56
  13. data/lib/cucumber/rails/database/deletion_strategy.rb +13 -0
  14. data/lib/cucumber/rails/database/shared_connection_strategy.rb +27 -0
  15. data/lib/cucumber/rails/database/strategy.rb +33 -0
  16. data/lib/cucumber/rails/database/truncation_strategy.rb +13 -0
  17. data/lib/cucumber/rails/hooks.rb +2 -0
  18. data/lib/cucumber/rails/hooks/active_record.rb +8 -4
  19. data/lib/cucumber/rails/hooks/allow_rescue.rb +2 -0
  20. data/lib/cucumber/rails/hooks/database_cleaner.rb +11 -3
  21. data/lib/cucumber/rails/hooks/mail.rb +3 -1
  22. data/lib/cucumber/rails/rspec.rb +3 -1
  23. data/lib/cucumber/rails/world.rb +24 -7
  24. data/lib/generators/cucumber/{install/USAGE → USAGE} +0 -0
  25. data/lib/generators/cucumber/{install/install_generator.rb → install_generator.rb} +18 -9
  26. data/lib/generators/cucumber/{install/templates → templates}/config/cucumber.yml.erb +0 -0
  27. data/lib/generators/cucumber/{install/templates → templates}/script/cucumber +1 -0
  28. data/lib/generators/cucumber/{install/templates → templates}/support/_rails_each_run.rb.erb +0 -0
  29. data/lib/generators/cucumber/{install/templates → templates}/support/_rails_prefork.rb.erb +0 -0
  30. data/lib/generators/cucumber/{install/templates → templates}/support/capybara.rb +2 -0
  31. data/lib/generators/cucumber/{install/templates → templates}/support/edit_warning.txt +0 -0
  32. data/lib/generators/cucumber/{install/templates → templates}/support/rails.rb.erb +0 -0
  33. data/lib/generators/cucumber/{install/templates → templates}/support/rails_spork.rb.erb +0 -0
  34. data/lib/generators/cucumber/{install/templates → templates}/tasks/cucumber.rake.erb +0 -0
  35. metadata +100 -169
  36. data/.github/ISSUE_TEMPLATE.md +0 -52
  37. data/.github/PULL_REQUEST_TEMPLATE.md +0 -42
  38. data/.gitignore +0 -13
  39. data/.rspec +0 -1
  40. data/.rubocop.yml +0 -1
  41. data/.rubocop_todo.yml +0 -443
  42. data/.travis.yml +0 -45
  43. data/Appraisals +0 -32
  44. data/Gemfile +0 -7
  45. data/Rakefile +0 -49
  46. data/bin/install_geckodriver.sh +0 -19
  47. data/bin/install_webpacker.sh +0 -9
  48. data/config/.gitignore +0 -1
  49. data/config/cucumber.yml +0 -17
  50. data/cucumber-rails.gemspec +0 -44
  51. data/dev_tasks/cucumber.rake +0 -3
  52. data/dev_tasks/rspec.rake +0 -3
  53. data/dev_tasks/yard.rake +0 -35
  54. data/dev_tasks/yard/default/layout/html/bubble_32x32.png +0 -0
  55. data/dev_tasks/yard/default/layout/html/footer.erb +0 -5
  56. data/dev_tasks/yard/default/layout/html/index.erb +0 -1
  57. data/dev_tasks/yard/default/layout/html/layout.erb +0 -25
  58. data/dev_tasks/yard/default/layout/html/logo.erb +0 -1
  59. data/dev_tasks/yard/default/layout/html/setup.rb +0 -4
  60. data/features/allow_rescue.feature +0 -65
  61. data/features/annotations.feature +0 -22
  62. data/features/capybara_javascript_drivers.feature +0 -73
  63. data/features/choose_javascript_database_strategy.feature +0 -145
  64. data/features/database_cleaner.feature +0 -44
  65. data/features/disable_automatic_database_cleaning.feature +0 -55
  66. data/features/emulate_javascript.feature +0 -94
  67. data/features/install_cucumber_rails.feature +0 -14
  68. data/features/no_database.feature +0 -61
  69. data/features/raising_errors.feature +0 -16
  70. data/features/rerun_profile.feature +0 -46
  71. data/features/rest_api.feature +0 -47
  72. data/features/step_definitions/cucumber_rails_steps.rb +0 -153
  73. data/features/support/aruba.rb +0 -3
  74. data/features/support/bundler_pre_support.rb +0 -28
  75. data/features/support/env.rb +0 -40
  76. data/features/support/fixtures/bundler-1.0.21.gem +0 -0
  77. data/features/support/fixtures/bundler-1.1.rc.gem +0 -0
  78. data/features/support/legacy_web_steps_support.rb +0 -289
  79. data/gemfiles/rails_4_2.gemfile +0 -10
  80. data/gemfiles/rails_5_0.gemfile +0 -10
  81. data/gemfiles/rails_5_1.gemfile +0 -10
  82. data/gemfiles/rails_5_2.gemfile +0 -10
  83. data/gemfiles/rails_6_0.gemfile +0 -8
  84. data/lib/cucumber/rails/action_controller.rb +0 -13
  85. data/spec/cucumber/rails/database_spec.rb +0 -57
  86. data/spec/generators/cucumber/install/install_generator_spec.rb +0 -47
  87. data/spec/spec_helper.rb +0 -14
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "railties", "~> 4.2.1"
6
- gem "i18n", "< 1.5.1", platform: :mri_22
7
- gem "capybara", "< 3.16.0", platform: [:mri_23, :mri_22]
8
- gem "nokogiri", "< 1.9.1", platform: [:mri_23, :mri_22]
9
-
10
- gemspec path: "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "railties", "~> 5.0.0"
6
- gem "i18n", "< 1.5.1", platform: :mri_22
7
- gem "capybara", "< 3.16.0", platform: [:mri_23, :mri_22]
8
- gem "nokogiri", "< 1.9.1", platform: [:mri_23, :mri_22]
9
-
10
- gemspec path: "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "railties", "~> 5.1.0"
6
- gem "i18n", "< 1.5.1", platform: :mri_22
7
- gem "capybara", "< 3.16.0", platform: [:mri_23, :mri_22]
8
- gem "nokogiri", "< 1.9.1", platform: [:mri_23, :mri_22]
9
-
10
- gemspec path: "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "railties", "~> 5.2"
6
- gem "i18n", "< 1.5.1", platform: :mri_22
7
- gem "capybara", "< 3.16.0", platform: [:mri_23, :mri_22]
8
- gem "nokogiri", "< 1.9.1", platform: [:mri_23, :mri_22]
9
-
10
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "railties", "~> 6.0.0.beta1"
6
- gem "rails", "~> 6.0.0.beta1"
7
-
8
- gemspec path: "../"
@@ -1,13 +0,0 @@
1
- ActionController::Base.class_eval do
2
- cattr_accessor :allow_rescue
3
- end
4
-
5
- class ActionDispatch::ShowExceptions
6
- alias __cucumber_orig_call__ call
7
-
8
- def call(env)
9
- env['action_dispatch.show_exceptions'] = !!ActionController::Base.allow_rescue
10
- env['action_dispatch.show_detailed_exceptions'] = !ActionController::Base.allow_rescue
11
- __cucumber_orig_call__(env)
12
- end
13
- end
@@ -1,57 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- require 'cucumber/rails/database'
3
-
4
- describe Cucumber::Rails::Database do
5
-
6
- let(:strategy) { double(before_js: nil, before_non_js: nil) }
7
-
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
11
-
12
- expect(strategy).to receive(:before_non_js).ordered
13
- Cucumber::Rails::Database.before_non_js
14
-
15
- expect(strategy).to receive(:before_js).ordered
16
- Cucumber::Rails::Database.before_js
17
- end
18
-
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)
21
- end
22
-
23
- describe 'using a custom strategy' do
24
- class ValidStrategy
25
- def before_js
26
- # Anything
27
- end
28
-
29
- def before_non_js
30
- # Likewise
31
- end
32
- end
33
-
34
- class InvalidStrategy
35
- end
36
-
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)
39
- end
40
-
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
44
-
45
- it 'forwards events to a custom strategy' do
46
- allow(ValidStrategy).to receive_messages(new: strategy)
47
- Cucumber::Rails::Database.javascript_strategy = ValidStrategy
48
-
49
- expect(strategy).to receive(:before_non_js).ordered
50
- Cucumber::Rails::Database.before_non_js
51
-
52
- expect(strategy).to receive(:before_js).ordered
53
- Cucumber::Rails::Database.before_js
54
- end
55
- end
56
-
57
- end
@@ -1,47 +0,0 @@
1
- require 'spec_helper'
2
-
3
- # Generators are not automatically loaded by Rails
4
- require 'generators/cucumber/install/install_generator'
5
-
6
- describe Cucumber::InstallGenerator do
7
- # Tell the generator where to put its output (what it thinks of as Rails.root)
8
- destination File.expand_path('../../../../../tmp', __FILE__)
9
-
10
- before { prepare_destination }
11
-
12
- describe 'no arguments' do
13
- before { run_generator }
14
-
15
- describe 'config/cucumber.yml' do
16
- subject { file('config/cucumber.yml') }
17
- it { is_expected.to exist }
18
- it { is_expected.to contain 'default: <%= std_opts %> features' }
19
- end
20
-
21
- describe 'features/step_definitions folder' do
22
- subject { file('features/step_definitions') }
23
- it { is_expected.to exist }
24
- end
25
-
26
- describe 'features/support/env.rb' do
27
- subject { file('features/support/env.rb') }
28
- it { is_expected.to exist }
29
- it { is_expected.to contain '# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.' }
30
- it { is_expected.to contain "require 'cucumber/rails'" }
31
- end
32
-
33
- describe 'lib/tasks/cucumber.rake' do
34
- subject { file('lib/tasks/cucumber.rake') }
35
- it { is_expected.to exist }
36
- it { is_expected.to contain '# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.' }
37
- it { is_expected.to contain "task cucumber: 'cucumber:ok'" }
38
- end
39
-
40
- describe 'script/cucumber' do
41
- subject { file('script/cucumber') }
42
- it { is_expected.to exist }
43
- it { is_expected.to contain 'load Cucumber::BINARY' }
44
- end
45
-
46
- end
47
- end
data/spec/spec_helper.rb DELETED
@@ -1,14 +0,0 @@
1
- require 'rspec/rails/fixture_support'
2
- require 'rails/all'
3
-
4
- ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
5
-
6
- module CucumberRails
7
- class Application < ::Rails::Application
8
- self.config.secret_key_base = 'ASecretString' if config.respond_to? :secret_key_base
9
- end
10
- end
11
-
12
- require 'rspec/support/spec'
13
- require 'rspec/rails'
14
- require 'ammeter/init'