Skip to content

Commit 5453a6a

Browse files
Add support for cucumber 9 (#97)
* Add support for cucumber 9 * update README, and run tests with Cucumber 9.x --------- Co-authored-by: Mathieu Jobin <[email protected]>
1 parent 137c35d commit 5453a6a

File tree

8 files changed

+25
-9
lines changed

8 files changed

+25
-9
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
matrix:
1818
rails: ["7.0", "6.1", "6.0"]
1919
ruby: ["3.2.2", "3.1.4", "3.0.6", "2.7.8"]
20-
cucumber: ["8.0", "7.0", "6.0", "5.0", "4.0", "3.0"]
20+
cucumber: ["9.0", "8.0", "7.0", "6.0", "5.0", "4.0", "3.0"]
2121

2222
env:
2323
RUBY_VERSION: ${{ matrix.ruby }}

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ gem "rails", "~> #{ENV['RAILS_VERSION'] || '7.0'}.0"
1010
gem "cucumber", "~> #{ENV['CUKES_VERSION'] || '7.0'}"
1111
gem "cucumber-rails"
1212
gem 'fabrication', github: 'mathieujobin/fabrication', ref: '923cf6fcefd0566b1d6be7bd2f685b89388f4800'
13+
gem 'sprockets-rails'

History.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
== 0.9.0
2+
* Added support for Cucumber 9.x
3+
14
== 0.8.0
25
* Added support for Cucumber 8.x
36
* Removed support for Rails 4.2 -> 5.2

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ Cucumber 4.x - should work with all Rails 5.x versions, tests only run for 5.2 a
1919
Cucumber 5.x - all tests pass for rails 5.2, 6.0 and 6.1
2020
Cucumber 6.x - all tests pass for rails 6.0, 6.1 and 7.0
2121
Cucumber 7.x - all tests pass for rails 6.0, 6.1 and 7.0
22+
Cucumber 8.x - all tests pass for rails 6.0, 6.1 and 7.0
23+
Cucumber 9.x - all tests pass for rails 6.0, 6.1 and 7.0
2224

2325
Please open pull-requests with fixes if you encounter any problems.
2426
No active development on this gem.
2527

26-
### Rails 5 and Rails 6
28+
### Rails 5.x, 6.x, and 7.x
2729

2830
Add the gem to your Gemfile:
2931

Rakefile.d/cucumber.rake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@ end
1414
namespace :cucumber do
1515
task :setup do
1616
current_gemfile = ENV['BUNDLE_GEMFILE']
17-
sh "BUNDLE_GEMFILE=#{current_gemfile} bundle show cucumber > /tmp/cukes_version"
18-
sh "BUNDLE_GEMFILE=#{current_gemfile} bundle show sqlite3 > /tmp/sqlite_version"
19-
cukes_version=File.read('/tmp/cukes_version').split('-').last.chomp
20-
sqlite_version=File.read('/tmp/sqlite_version').split('-').last.chomp
17+
cukes_version = Gem.loaded_specs['cucumber'].version
18+
sqlite_version = Gem.loaded_specs['sqlite3'].version
2119
puts "Versions: Cucumber #{cukes_version}, SQLite #{sqlite_version}."
2220
Bundler.with_clean_env do
2321
gemfile = "cucumber_test_app/Gemfile"
2422
rm_rf "cucumber_test_app"
2523
sh "BUNDLE_GEMFILE=#{current_gemfile} bundle exec rails new cucumber_test_app --skip-spring --skip-javascript --skip-sprockets --skip-bootsnap"
2624
sh "echo 'gem \"cucumber\", \"~> #{cukes_version}\", :require => false' >> #{gemfile}"
27-
sh "sed -i 's/gem .sqlite3./gem \"sqlite3\", \"~> #{sqlite_version}\"/' #{gemfile}"
25+
sh "sed -i'' -e 's/gem .sqlite3./gem \"sqlite3\", \"~> #{sqlite_version}\"/' #{gemfile}"
2826
sh "cat #{gemfile} | grep sqli"
2927
sh "echo 'gem \"cucumber-rails\", :require => false' >> #{gemfile}"
3028
sh "echo 'gem \"rspec-rails\", \"~>3.0\"' >> #{gemfile}"

features/support/env.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,16 @@
1717
require 'cucumber/rails'
1818
Capybara.default_selector = :css
1919
ActionController::Base.allow_rescue = false
20+
21+
require 'database_cleaner/active_record'
2022
DatabaseCleaner.strategy = :truncation
23+
24+
Around do |scenario, block|
25+
DatabaseCleaner.cleaning(&block)
26+
end
27+
28+
# 'Fixnum' and 'Bignum' are deprecated since ruby-3.2 (both replaced by 'Integer')
29+
# But 'machinist' still uses 'Fixnum', so we have to use workaround:
30+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.2')
31+
class Fixnum < Integer; end
32+
end

lib/pickle/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Pickle
2-
VERSION = "0.8.0"
2+
VERSION = "0.9.0"
33
end

pickle.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
1919
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
2020
s.require_paths = ["lib"]
2121

22-
s.add_dependency "cucumber", ">=3.0", "< 9.0"
22+
s.add_dependency "cucumber", ">=3.0", "< 10.0"
2323
s.add_dependency "rake"
2424

2525
s.add_development_dependency "rack"

0 commit comments

Comments
 (0)