Skip to content

Commit

Permalink
V3/additional cleanups (#572)
Browse files Browse the repository at this point in the history
* Change location of cucumber script

* Remove WIP profile and excess % tag from cucumber.yml template

* Alter the env.rb generation to use fewer files - remove un-necessary capybara comments and mimic the destination file name

* Initial bump to capybara dependency to something not completely legacy - needs to be bumped more

* initial bump to cucumber version to something non legacy

* Nokogiri is not a primary dependency of this gem since v1.2.2 - so remove it

* Use a later rubygems version to avoid any legacy mismatches with installing sqlite3 or other compiled gems

* use newer aruba with newer appending method

* Reinstate extra % symbol that is needed when copying / parsing

* Remove excess newline char that is no longer needed

* Ensure latest rubygems version is used

* Improving styling of gemspec and remove rdoc verbosely from gemspec

* Update changelog
  • Loading branch information
luke-hill authored Oct 2, 2023
1 parent fb2c6e9 commit dc4fa79
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 45 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler: '2.4.19'
rubygems: latest
bundler-cache: true
- run: bundle exec rake spec
- run: bundle exec rubocop
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ coverage
.bundle
.rvmrc
.yardoc/
.rvmrc
.cucumber.rerun
gemfiles/*.lock
Gemfile.lock
Expand Down
18 changes: 11 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ This file is intended to be modified using the [`changelog`](github.com/cucumber

## [Unreleased]
### Fixed
* Some of the rails 5.2 tests were installing lots of old conflicting gems ([luke-hill])
- Some of the rails 5.2 tests were installing lots of old conflicting gems ([luke-hill])
- Generator updates:
- Updated the install locations for some scripts from `script/` to `bin/`
- Changed some install generators to remove some legacy items
- Updates have facilitated minimum support versions altering: capybara must be `v3.11+` and cucumber must be `v5+`
([luke-hill])

## [3.0.0.rc.1] - 2023-09-15
### Removed
Expand All @@ -23,19 +28,18 @@ This file is intended to be modified using the [`changelog`](github.com/cucumber

## [2.6.0] - 2022-10-07
### New Features
* Dependabot has now been added to the repo (Alongside this a bunch of gem updates have been done)
- Dependabot has now been added to the repo (Alongside this a bunch of gem updates have been done)
([#540](https://github.com/cucumber/cucumber-rails/pull/540) [mattwynne])

### Changed
* Gem update: allowed cucumber 8 ([#538](https://github.com/cucumber/cucumber-rails/pull/538) / [#541](https://github.com/cucumber/cucumber-rails/pull/541) [mattwynne])

* New release process. Older releases are in [this changelog](./CHANGELOG.old.md)
- Gem update: allowed cucumber 8 ([#538](https://github.com/cucumber/cucumber-rails/pull/538) / [#541](https://github.com/cucumber/cucumber-rails/pull/541) [mattwynne])
- New release process. Older releases are in [this changelog](./CHANGELOG.old.md)

### Fixed
* Some bugs with dev dependencies have now been fixed externally, so these have been unrestricted
- Some bugs with dev dependencies have now been fixed externally, so these have been unrestricted
([#552](https://github.com/cucumber/cucumber-rails/pull/552) [BrianHawley])

* Fixed up some rubocop offenses from updated `rubocop-performance`
- Fixed up some rubocop offenses from updated `rubocop-performance`
([#550](https://github.com/cucumber/cucumber-rails/pull/550) [olleolleolle])

[Unreleased]: https://github.com/cucumber/cucumber-rails/compare/v3.0.0.rc.1...main
Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require 'rubygems'
require 'bundler'
require 'bundler/setup'
require 'appraisal'
require 'rdoc'
require 'rake/clean'
require 'pathname'
Bundler::GemHelper.install_tasks
Expand Down
18 changes: 8 additions & 10 deletions cucumber-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ Gem::Specification.new do |s|
'source_code_uri' => "https://github.com/cucumber/cucumber-rails/tree/v#{s.version}"
}

s.add_runtime_dependency('capybara', ['>= 2.18', '< 4'])
s.add_runtime_dependency('cucumber', '>= 3.2', '< 9')
s.add_runtime_dependency('nokogiri', '~> 1.10')
s.add_runtime_dependency('railties', ['>= 5.2', '< 8'])
s.add_runtime_dependency('capybara', '>= 3.11', '< 4')
s.add_runtime_dependency('cucumber', '>= 5', '< 9')
s.add_runtime_dependency('railties', '>= 5.2', '< 8')

# Main development dependencies
s.add_development_dependency('ammeter', '>= 1.1.4')
s.add_development_dependency('appraisal', ['>= 2.4.1', '< 3'])
s.add_development_dependency('aruba', ['>= 1.0', '< 3'])
s.add_development_dependency('appraisal', '>= 2.4.1', '< 3')
s.add_development_dependency('aruba', '>= 1.1.2', '< 3')
s.add_development_dependency('bundler', '>= 1.17')
s.add_development_dependency('database_cleaner', ['>= 1.8', '< 3.0'])
s.add_development_dependency('rails', ['>= 5.2', '< 8'])
s.add_development_dependency('database_cleaner', '>= 1.8', '< 3.0')
s.add_development_dependency('rails', '>= 5.2', '< 8')
s.add_development_dependency('rake', '>= 12.0')
s.add_development_dependency('rspec', '~> 3.6')
s.add_development_dependency('rubocop', '~> 1.28.2')
Expand All @@ -42,11 +41,10 @@ Gem::Specification.new do |s|
s.add_development_dependency('sqlite3', '~> 1.3')

# For Documentation:
s.add_development_dependency('rdoc', '>= 6.0')
s.add_development_dependency('yard', '~> 0.9.10')

s.required_ruby_version = '>= 2.6.0'
s.required_rubygems_version = '>= 3.0.1'
s.required_rubygems_version = '>= 3.2.3'
s.require_path = 'lib'
s.files = Dir['lib/**/*', 'CHANGELOG.md', 'CONTRIBUTING.md', 'LICENSE', 'README.md']
end
4 changes: 1 addition & 3 deletions features/emulate_javascript.feature
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@ Feature: Emulate Javascript
And I should be on the widgets page
And I should not see "wrench"
"""
And I append to "features/step_definitions/widget_steps.rb" with:
# TODO: Remove the newline below (Required) once bug is fixed: https://github.com/cucumber/aruba/issues/662
And I append the following lines to "features/step_definitions/widget_steps.rb":
"""
Given('I am on the session establish page') do
visit session_establish_path
end
Expand Down
10 changes: 5 additions & 5 deletions features/install_cucumber_rails.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Feature: Install Cucumber Rails
Scenario: Install Cucumber-Rails
Given I have created a new Rails app and installed cucumber-rails
Then the following files should exist:
| config/cucumber.yml |
| script/cucumber |
| features/support/env.rb |
| features/step_definitions/.gitkeep |
| lib/tasks/cucumber.rake |
| config/cucumber.yml |
| bin/cucumber |
| features/support/env.rb |
| features/step_definitions/.keep |
| lib/tasks/cucumber.rake |
And the file "features/support/env.rb" should contain "require 'cucumber/rails'"
8 changes: 4 additions & 4 deletions lib/generators/cucumber/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ def create_templates
end

def create_scripts
copy_file 'script/cucumber', 'script/cucumber'
chmod 'script/cucumber', 0755
copy_file 'bin/cucumber', 'bin/cucumber'
chmod 'bin/cucumber', 0755
end

def create_step_definitions
empty_directory 'features/step_definitions'
create_file 'features/step_definitions/.gitkeep'
create_file 'features/step_definitions/.keep'
end

def create_feature_support
empty_directory 'features/support'
template 'support/rails.rb.erb', 'features/support/env.rb'
template 'support/env.rb.erb', 'features/support/env.rb'
end

def configure_environment
Expand Down
1 change: 0 additions & 1 deletion lib/generators/cucumber/templates/config/cucumber.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ rerun_opts = rerun.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} fe
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags 'not @wip'"
%>
default: <%%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%%= rerun_opts %> --format rerun --out rerun.txt --strict --tags 'not @wip'

This file was deleted.

6 changes: 0 additions & 6 deletions lib/generators/cucumber/templates/support/capybara.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<%= embed_file('support/edit_warning.txt') %>

require 'cucumber/rails'

# By default, any exception happening in your Rails application will bubble up
# to Cucumber so that your scenario will fail. This is a different from how
# your application behaves in the production environment, where an error page will
Expand Down
4 changes: 0 additions & 4 deletions lib/generators/cucumber/templates/support/rails.rb.erb

This file was deleted.

4 changes: 2 additions & 2 deletions spec/generators/cucumber/install_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def create_config_files_the_generator_is_expected_to_modify
it { is_expected.to contain "task cucumber: 'cucumber:ok'" }
end

describe 'script/cucumber' do
subject { file('script/cucumber') }
describe 'bin/cucumber' do
subject { file('bin/cucumber') }

it { is_expected.to exist }
it { is_expected.to contain 'load Cucumber::BINARY' }
Expand Down

0 comments on commit dc4fa79

Please sign in to comment.