cucumber-rails 2.0.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +135 -18
  3. data/CONTRIBUTING.md +14 -2
  4. data/LICENSE +1 -1
  5. data/README.md +5 -24
  6. data/lib/cucumber/rails.rb +11 -13
  7. data/lib/cucumber/rails/action_dispatch.rb +21 -0
  8. data/lib/cucumber/rails/application.rb +11 -8
  9. data/lib/cucumber/rails/capybara/javascript_emulation.rb +27 -16
  10. data/lib/cucumber/rails/database.rb +7 -57
  11. data/lib/cucumber/rails/database/deletion_strategy.rb +13 -0
  12. data/lib/cucumber/rails/database/shared_connection_strategy.rb +27 -0
  13. data/lib/cucumber/rails/database/strategy.rb +35 -0
  14. data/lib/cucumber/rails/database/truncation_strategy.rb +13 -0
  15. data/lib/cucumber/rails/hooks/database_cleaner.rb +9 -3
  16. data/lib/cucumber/rails/hooks/mail.rb +1 -1
  17. data/lib/cucumber/rails/world.rb +2 -2
  18. data/lib/generators/cucumber/install_generator.rb +10 -13
  19. data/lib/generators/cucumber/templates/config/cucumber.yml.erb +3 -3
  20. data/lib/generators/cucumber/templates/tasks/cucumber.rake.erb +5 -0
  21. metadata +92 -99
  22. data/.github/ISSUE_TEMPLATE.md +0 -52
  23. data/.github/PULL_REQUEST_TEMPLATE.md +0 -42
  24. data/.gitignore +0 -14
  25. data/.rspec +0 -4
  26. data/.rubocop.yml +0 -33
  27. data/.rubocop_todo.yml +0 -59
  28. data/.travis.yml +0 -60
  29. data/Appraisals +0 -35
  30. data/Gemfile +0 -5
  31. data/Rakefile +0 -53
  32. data/bin/install_geckodriver.sh +0 -19
  33. data/bin/install_webpacker.sh +0 -9
  34. data/config/.gitignore +0 -1
  35. data/config/cucumber.yml +0 -17
  36. data/cucumber-rails.gemspec +0 -44
  37. data/dev_tasks/cucumber.rake +0 -5
  38. data/dev_tasks/rspec.rake +0 -5
  39. data/dev_tasks/yard.rake +0 -36
  40. data/dev_tasks/yard/default/layout/html/bubble_32x32.png +0 -0
  41. data/dev_tasks/yard/default/layout/html/footer.erb +0 -5
  42. data/dev_tasks/yard/default/layout/html/index.erb +0 -1
  43. data/dev_tasks/yard/default/layout/html/layout.erb +0 -25
  44. data/dev_tasks/yard/default/layout/html/logo.erb +0 -1
  45. data/dev_tasks/yard/default/layout/html/setup.rb +0 -9
  46. data/features/allow_rescue.feature +0 -65
  47. data/features/annotations.feature +0 -20
  48. data/features/capybara_javascript_drivers.feature +0 -82
  49. data/features/choose_javascript_database_strategy.feature +0 -125
  50. data/features/configuration.feature +0 -48
  51. data/features/database_cleaner.feature +0 -44
  52. data/features/disable_automatic_database_cleaning.feature +0 -49
  53. data/features/emulate_javascript.feature +0 -109
  54. data/features/install_cucumber_rails.feature +0 -14
  55. data/features/no_database.feature +0 -61
  56. data/features/raising_errors.feature +0 -22
  57. data/features/rerun_profile.feature +0 -47
  58. data/features/rest_api.feature +0 -47
  59. data/features/step_definitions/cucumber_rails_steps.rb +0 -69
  60. data/features/support/aruba.rb +0 -5
  61. data/features/support/cucumber_rails_helper.rb +0 -76
  62. data/features/support/env.rb +0 -6
  63. data/features/support/hooks.rb +0 -8
  64. data/gemfiles/rails_4_2.gemfile +0 -10
  65. data/gemfiles/rails_5_0.gemfile +0 -10
  66. data/gemfiles/rails_5_1.gemfile +0 -10
  67. data/gemfiles/rails_5_2.gemfile +0 -10
  68. data/gemfiles/rails_6_0.gemfile +0 -9
  69. data/lib/cucumber/rails/action_controller.rb +0 -17
  70. data/lib/generators/cucumber/templates/support/rails_spork.rb.erb +0 -13
  71. data/spec/cucumber/rails/database_spec.rb +0 -61
  72. data/spec/generators/cucumber/install_generator_spec.rb +0 -55
  73. data/spec/spec_helper.rb +0 -16
@@ -1,52 +0,0 @@
1
- <!-- NAMING YOUR ISSUE: Please prefix your issue with the name of the sub-project -->
2
- <!-- e.g. `event-protocol: Schemas out of date` -->
3
- <!-- This makes it easier to get some context when reading the names of issues -->
4
-
5
- <!-- These sections are meant as guidance for you, to help you give the kind of information we'll need to help with your issue. If a section doesn't seem to fit, just skip it.
6
-
7
- In general: Please provide as much information as you can to help us solving your problem -->
8
-
9
- ## Summary
10
-
11
- <!--- Provide a general summary description of the issue -->
12
-
13
- ## Expected Behavior
14
-
15
- <!--- If you're describing a bug, tell us what should happen -->
16
- <!--- If you're suggesting a change/improvement, tell us how it should work -->
17
- <!--- Feel free to use Given / Then / Then if that helps, but please add some plain-language context too -->
18
-
19
- ## Current Behavior
20
-
21
- <!--- If describing a bug, tell us what happens instead of the expected behavior -->
22
- <!--- If suggesting a change/improvement, explain the difference from current behavior -->
23
-
24
- <!--- If you have got some output place it in the code block below. Otherwise remove it. -->
25
- ~~~
26
- ~~~
27
-
28
- ## Possible Solution
29
-
30
- <!--- Not obligatory, but suggest a fix/reason for the bug, -->
31
- <!--- or ideas how to implement the addition or change -->
32
-
33
- ## Steps to Reproduce (for bugs)
34
-
35
- <!--- Provide a link to a live example, or an unambiguous set of steps to -->
36
- <!--- reproduce this bug. Include code to reproduce, if relevant -->
37
- 1.
38
- 2.
39
- 3.
40
- 4.
41
-
42
- ## Context & Motivation
43
-
44
- <!--- How has this issue affected you? What are you trying to accomplish? -->
45
- <!--- Providing context helps us come up with a solution that is most useful in the real world -->
46
-
47
- ## Your Environment
48
-
49
- <!--- If you're reporting a bug, include as many relevant details about the environment you experienced the bug in -->
50
- * Version used:
51
- * Operating System and version:
52
- * Link to your project:
@@ -1,42 +0,0 @@
1
- <!-- NAMING YOUR PULL REQUEST: Please choose a concise, descriptive name for your pull request. -->
2
- <!-- This makes it easier to get some context when reading the names of issues -->
3
-
4
- <!-- These sections are meant as guidance for you. If something doesn't fit, you can just skip it. -->
5
-
6
- ## Summary
7
-
8
- <!--- Provide a general summary description of your changes -->
9
-
10
- ## Details
11
-
12
- <!--- Describe your changes in detail -->
13
-
14
- ## Motivation and Context
15
-
16
- <!--- Why is this change required? What problem does it solve? -->
17
- <!--- If it fixes an open issue, please link to the issue here. -->
18
-
19
- ## How Has This Been Tested?
20
-
21
- <!--- Please add tests for changes to the code, otherwise we probably won't merge it -->
22
-
23
- <!--- Please describe in detail how you tested your changes. -->
24
- <!--- Include details of your testing environment, tests ran to see how -->
25
- <!--- your change affects other areas of the code, etc. -->
26
-
27
- ## Screenshots (if appropriate):
28
-
29
- ## Types of changes
30
-
31
- <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
32
- - [ ] Bug fix (non-breaking change which fixes an issue).
33
- - [ ] New feature (non-breaking change which adds functionality).
34
- - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected).
35
-
36
- ## Checklist:
37
-
38
- <!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
39
- <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
40
- - [ ] I've added tests for my code.
41
- - [ ] My change requires a change to the documentation.
42
- - [ ] I have updated the documentation accordingly.
data/.gitignore DELETED
@@ -1,14 +0,0 @@
1
- pkg
2
- doc
3
- tmp
4
- coverage
5
- .bundle
6
- .rvmrc
7
- .yardoc/
8
- .rvmrc
9
- .cucumber.rerun
10
- gemfiles/*.lock
11
- Gemfile.lock
12
- spec/examples.txt
13
- .idea
14
- .ruby-version
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --format progress
2
- --color
3
- --order random
4
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,33 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- require:
4
- - rubocop-rspec
5
- - rubocop-performance
6
-
7
- AllCops:
8
- TargetRubyVersion: 2.3
9
- Exclude:
10
- # These are auto-generated from a load of features that we
11
- # don't have direct control over
12
- - 'tmp/**/*'
13
- # Generated by appraisal
14
- - 'gemfiles/*.gemfile'
15
-
16
- Style/Documentation:
17
- Enabled: false
18
-
19
- Metrics/LineLength:
20
- Max: 200
21
- IgnoredPatterns:
22
- - '^Given'
23
- - '^When'
24
- - '^Then'
25
-
26
- Style/RegexpLiteral:
27
- EnforcedStyle: slashes
28
- AllowInnerSlashes: true
29
-
30
- BlockLength:
31
- Exclude:
32
- - './spec/**/*_spec.rb'
33
- - 'cucumber-rails.gemspec'
data/.rubocop_todo.yml DELETED
@@ -1,59 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2019-07-31 11:34:26 +0200 using RuboCop version 0.72.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: AllowForAlignment.
12
- Layout/SpaceAroundOperators:
13
- Exclude:
14
- - 'dev_tasks/yard.rake'
15
-
16
- # Offense count: 2
17
- # Configuration parameters: AllowComments.
18
- Lint/HandleExceptions:
19
- Exclude:
20
- - 'lib/cucumber/rails/hooks/database_cleaner.rb'
21
- - 'lib/cucumber/rails/world.rb'
22
-
23
- # Offense count: 3
24
- Metrics/AbcSize:
25
- Max: 19
26
-
27
- # Offense count: 3
28
- # Configuration parameters: CountComments, ExcludedMethods.
29
- Metrics/MethodLength:
30
- Max: 18
31
-
32
- # Offense count: 4
33
- # Configuration parameters: .
34
- # SupportedStyles: have_received, receive
35
- RSpec/MessageSpies:
36
- EnforcedStyle: receive
37
-
38
- # Offense count: 2
39
- # Configuration parameters: AggregateFailuresByDefault.
40
- RSpec/MultipleExpectations:
41
- Max: 2
42
-
43
- # Offense count: 1
44
- Style/DoubleNegation:
45
- Exclude:
46
- - 'lib/cucumber/rails/action_controller.rb'
47
-
48
- # Offense count: 1
49
- Style/MixinUsage:
50
- Exclude:
51
- - 'lib/cucumber/rails/rspec.rb'
52
-
53
- # Offense count: 1
54
- # Cop supports --auto-correct.
55
- # Configuration parameters: EnforcedOctalStyle.
56
- # SupportedOctalStyles: zero_with_o, zero_only
57
- Style/NumericLiteralPrefix:
58
- Exclude:
59
- - 'lib/generators/cucumber/install_generator.rb'
data/.travis.yml DELETED
@@ -1,60 +0,0 @@
1
- language: ruby
2
-
3
- dist: xenial
4
-
5
- rvm:
6
- - 2.3
7
- - 2.4
8
- - 2.5
9
- - 2.6
10
- - ruby-head
11
-
12
- addons:
13
- firefox: latest
14
-
15
- branches:
16
- only:
17
- - master
18
-
19
- services:
20
- - xvfb
21
-
22
- gemfile:
23
- - gemfiles/rails_6_0.gemfile
24
- - gemfiles/rails_5_2.gemfile
25
- - gemfiles/rails_5_1.gemfile
26
- - gemfiles/rails_5_0.gemfile
27
- - gemfiles/rails_4_2.gemfile
28
-
29
- matrix:
30
- fast_finish: true
31
- allow_failures:
32
- - rvm: ruby-head
33
- exclude:
34
- # Only test Rails6 on supported rubies
35
- # Don't test lowest rails support on maintained rubies
36
- - rvm: 2.3
37
- gemfile: gemfiles/rails_6_0.gemfile
38
- - rvm: 2.4
39
- gemfile: gemfiles/rails_4_2.gemfile
40
- - rvm: 2.4
41
- gemfile: gemfiles/rails_6_0.gemfile
42
- - rvm: 2.5
43
- gemfile: gemfiles/rails_4_2.gemfile
44
- - rvm: 2.6
45
- gemfile: gemfiles/rails_4_2.gemfile
46
- - rvm: 2.6
47
- gemfile: gemfiles/rails_5_0.gemfile
48
- - rvm: 2.6
49
- gemfile: gemfiles/rails_5_1.gemfile
50
- - rvm: ruby-head
51
- gemfile: gemfiles/rails_4_2.gemfile
52
- - rvm: ruby-head
53
- gemfile: gemfiles/rails_5_0.gemfile
54
- - rvm: ruby-head
55
- gemfile: gemfiles/rails_5_1.gemfile
56
-
57
- before_install:
58
- - gem install --remote bundler -v '~> 1.17'
59
- - bin/install_geckodriver.sh
60
- - bin/install_webpacker.sh
data/Appraisals DELETED
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- appraise 'rails_4_2' do
4
- gem 'capybara', '< 3.16.0', platform: :mri_23
5
- gem 'nokogiri', '< 1.9.1', platform: :mri_23
6
- gem 'railties', '~> 4.2.11'
7
- gem 'sqlite3', '~> 1.3.13'
8
- end
9
-
10
- appraise 'rails_5_0' do
11
- gem 'capybara', '< 3.16.0', platform: :mri_23
12
- gem 'nokogiri', '< 1.9.1', platform: :mri_23
13
- gem 'railties', '~> 5.0.7'
14
- gem 'sqlite3', '~> 1.3.13'
15
- end
16
-
17
- appraise 'rails_5_1' do
18
- gem 'capybara', '< 3.16.0', platform: :mri_23
19
- gem 'nokogiri', '< 1.9.1', platform: :mri_23
20
- gem 'railties', '~> 5.1.7'
21
- gem 'sqlite3', '~> 1.3.13'
22
- end
23
-
24
- appraise 'rails_5_2' do
25
- gem 'capybara', '< 3.16.0', platform: :mri_23
26
- gem 'nokogiri', '< 1.9.1', platform: :mri_23
27
- gem 'railties', '~> 5.2.0'
28
- gem 'sqlite3', '~> 1.3.13'
29
- end
30
-
31
- appraise 'rails_6_0' do
32
- gem 'railties', '~> 6.0.0'
33
- gem 'rails', '~> 6.0.0'
34
- gem 'sqlite3', '~> 1.4'
35
- end
data/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
data/Rakefile DELETED
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- CUCUMBER_RAILS_VERSION =
4
- Gem::Specification.load(File.dirname(__FILE__) + '/cucumber-rails.gemspec').version.version
5
- require 'rubygems'
6
- require 'bundler'
7
- require 'bundler/setup'
8
- require 'appraisal'
9
- require 'rdoc' # https://github.com/lsegal/yard/commit/b861dcc2d7f7e1fbbed7b552ac2e4f7caf68bafa
10
- require 'rake/clean'
11
- require 'pathname'
12
- Bundler::GemHelper.install_tasks
13
-
14
- $LOAD_PATH.unshift(File.dirname(__FILE__) + '/lib')
15
- Dir["#{File.dirname(__FILE__)}/dev_tasks/*.rake"].sort.each { |ext| load ext }
16
-
17
- CLEAN.include('doc', 'tmp')
18
-
19
- task default: :test
20
-
21
- task test: %i[spec cucumber]
22
-
23
- namespace :test do
24
- desc 'Run tests against all gemfiles'
25
- task :all do
26
- Rake::Task['appraisal'].invoke('test')
27
- end
28
-
29
- desc 'Run tests against specified gemfile, e.g. rake test:gemfile[rails_3_0]'
30
- task :gemfile, :name do |_task, args|
31
- unless args.name && Pathname.new("gemfiles/#{args.name}.gemfile").exist?
32
- raise ArgumentError "You must provide the name of an existing Appraisal gemfile,
33
- e.g. 'rake test:gemfile[rails_4_2]'"
34
- end
35
-
36
- Rake::Task["appraisal:#{args.name}"].invoke('test')
37
- end
38
- end
39
-
40
- namespace :gemfiles do
41
- desc 'Install dependencies for all gemfiles'
42
- task :install do
43
- ENV['BUNDLE_GEMFILE'] = 'Gemfile.appraisal'
44
- Rake::Task['appraisal:install'].invoke
45
- end
46
-
47
- task :clean do
48
- FileUtils.rm_rf('gemfiles/*')
49
- end
50
-
51
- desc 'Rebuild generated gemfiles and install dependencies'
52
- task rebuild: %i[clean install]
53
- end
@@ -1,19 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -xeuo pipefail
4
-
5
- curl --silent \
6
- --show-error \
7
- --location \
8
- --fail \
9
- --retry 3 \
10
- --output /tmp/geckodriver_linux64.tar.gz \
11
- https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
12
-
13
- sudo tar -C /usr/local/bin -xvzf /tmp/geckodriver_linux64.tar.gz geckodriver
14
-
15
- rm /tmp/geckodriver_linux64.tar.gz
16
-
17
- geckodriver --version
18
-
19
- set +x
@@ -1,9 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -xeuo pipefail
4
-
5
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
6
- echo 'deb https://dl.yarnpkg.com/debian/ stable main' | sudo tee /etc/apt/sources.list.d/yarn.list
7
- sudo apt update && sudo apt install --yes yarn
8
-
9
- set +x
data/config/.gitignore DELETED
@@ -1 +0,0 @@
1
- aruba-rvm.yml
data/config/cucumber.yml DELETED
@@ -1,17 +0,0 @@
1
- <%
2
- rerun_file = '.cucumber.rerun'
3
- failing_scenarios = IO.read(rerun_file) rescue ''
4
- path = if failing_scenarios.empty?
5
- 'features'
6
- else
7
- puts "Running failed scenarios"
8
- failing_scenarios.gsub /\s/, ' '
9
- end
10
- opts = [
11
- "--format #{path == 'features' ? 'progress' : 'pretty'}",
12
- "--format rerun -o #{rerun_file}"
13
- ]
14
- rails_version = `bundle exec rails --version`.match(/[\d.]+$/).to_s
15
- optlist = opts.join(' ')
16
- %>
17
- default: <%= path %> <%= optlist %> --tags 'not @broken'
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- $LOAD_PATH.unshift File.expand_path('lib', __dir__)
4
-
5
- Gem::Specification.new do |s|
6
- s.name = 'cucumber-rails'
7
- s.version = '2.0.0'
8
- s.authors = ['Aslak Hellesøy', 'Dennis Blöte', 'Rob Holland']
9
- s.description = 'Cucumber Generator and Runtime for Rails'
10
- s.summary = "#{s.name}-#{s.version}"
11
- s.email = 'cukes@googlegroups.com'
12
- s.homepage = 'http://cukes.info'
13
-
14
- s.license = 'MIT'
15
-
16
- s.add_runtime_dependency('capybara', ['>= 2.12', '< 4'])
17
- s.add_runtime_dependency('cucumber', ['>= 3.0.2', '< 4'])
18
- s.add_runtime_dependency('mime-types', ['>= 2.0', '< 4'])
19
- s.add_runtime_dependency('nokogiri', '~> 1.8')
20
- s.add_runtime_dependency('railties', ['>= 4.2', '< 7'])
21
-
22
- # Main development dependencies
23
- s.add_development_dependency('ammeter', '>= 1.1.4')
24
- s.add_development_dependency('aruba', '~> 0.14.4')
25
- s.add_development_dependency('appraisal', '~> 2.2')
26
- s.add_development_dependency('bundler', '>= 1.17')
27
- s.add_development_dependency('rails', ['>= 4.2', '< 7'])
28
- s.add_development_dependency('rake', '>= 12.0')
29
- s.add_development_dependency('rspec', '~> 3.6')
30
- s.add_development_dependency('rubocop', '~> 0.72.0')
31
- s.add_development_dependency('rubocop-performance', '~> 1.4.0')
32
- s.add_development_dependency('rubocop-rspec', '~> 1.33.0')
33
- s.add_development_dependency('sqlite3', '~> 1.3')
34
-
35
- # For Documentation:
36
- s.add_development_dependency('rdoc', '>= 6.0')
37
- s.add_development_dependency('yard', '~> 0.9.10')
38
-
39
- s.required_ruby_version = '>= 2.3.0'
40
- s.rubygems_version = '>= 1.6.1'
41
- s.files = `git ls-files`.split("\n")
42
- s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
43
- s.require_path = 'lib'
44
- end