Skip to content

Commit

Permalink
Support for Rails 7.1 and Ruby 3.3 (#98)
Browse files Browse the repository at this point in the history
* rails 7.1 and ruby 3.3
* Update tests, README and History file
* set 3.3.0 as default
  • Loading branch information
mathieujobin committed Jan 10, 2024
1 parent 5453a6a commit a2b62ce
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
strategy:
fail-fast: false
matrix:
rails: ["7.0", "6.1", "6.0"]
ruby: ["3.2.2", "3.1.4", "3.0.6", "2.7.8"]
rails: ["7.1", "7.0", "6.1", "6.0"]
ruby: ["3.3", "3.2.2", "3.1.4", "3.0.6", "2.7.8"]
cucumber: ["9.0", "8.0", "7.0", "6.0", "5.0", "4.0", "3.0"]

env:
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ git_source(:github){ |repo_name| "https://github.com/#{repo_name}.git" }
gemspec :path => "."

# use ENV vars, with default value as fallback for local setup
ruby (ENV['RUBY_VERSION'] || '3.2.2')
gem "rails", "~> #{ENV['RAILS_VERSION'] || '7.0'}.0"
gem "cucumber", "~> #{ENV['CUKES_VERSION'] || '7.0'}"
ruby (ENV['RUBY_VERSION'] || '3.3.0')
gem "rails", "~> #{ENV['RAILS_VERSION'] || '7.1'}.0"
gem "cucumber", "~> #{ENV['CUKES_VERSION'] || '9.0'}"
gem "cucumber-rails"
gem 'fabrication', github: 'mathieujobin/fabrication', ref: '923cf6fcefd0566b1d6be7bd2f685b89388f4800'
gem 'sprockets-rails'
3 changes: 3 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
== 0.9.1
* Added support for Rails 7.1

== 0.9.0
* Added support for Cucumber 9.x

Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ This is a quickstart guide for rails apps. Firstly, install [cucumber-rails](ht
## Supported versions

Cucumber 2.x - support was dropped from release 0.6.0
Cucumber 3.x - support is best-effort basis, but tests run on rails 4.2 all the way until 6.1
Cucumber 4.x - should work with all Rails 5.x versions, tests only run for 5.2 and 6.0
Cucumber 5.x - all tests pass for rails 5.2, 6.0 and 6.1
Cucumber 6.x - all tests pass for rails 6.0, 6.1 and 7.0
Cucumber 7.x - all tests pass for rails 6.0, 6.1 and 7.0
Cucumber 8.x - all tests pass for rails 6.0, 6.1 and 7.0
Cucumber 9.x - all tests pass for rails 6.0, 6.1 and 7.0
Rails 4.x and 5.x - Support for Cucumber 3.x -> 7.x; Dropped in 0.8.0
Rails 6.x and 7.x - Support for Cucumber 3.x -> 9.x

Please open pull-requests with fixes if you encounter any problems.
No active development on this gem.
Expand Down
2 changes: 1 addition & 1 deletion lib/pickle/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Pickle
VERSION = "0.9.0"
VERSION = "0.9.1"
end
3 changes: 2 additions & 1 deletion pickle.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Gem::Specification.new do |s|
s.add_development_dependency "bundler"
s.add_development_dependency "git"
s.add_development_dependency "yard"
s.add_development_dependency "rspec-rails", "~>3.0"
s.add_development_dependency "rspec-rails", ">= 3.0"
s.add_development_dependency "rspec-mocks", ">= 3.12.4"
s.add_development_dependency "rails", ">= 6.0", "< 8.0"
s.add_development_dependency "cucumber-rails"
s.add_development_dependency "factory_bot"
Expand Down
16 changes: 8 additions & 8 deletions spec/pickle/session_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ class Model
end

it "#create_models_from_table(<plural factory>, <table>) should call create_model for each of the table hashes with plain factory name and return the models" do
expect(self).to receive(:create_model).with("user", 'name' => "Fred").once.ordered.and_return(:fred)
expect(self).to receive(:create_model).with("user", 'name' => "Betty").once.ordered.and_return(:betty)
expect(self).to receive(:create_model).with("user", {"name" => "Fred"}).once.ordered.and_return(:fred)
expect(self).to receive(:create_model).with("user", {"name" => "Betty"}).once.ordered.and_return(:betty)
expect(create_models_from_table("users", table)).to eq([:fred, :betty])
end

it "#find_models_from_table(<plural factory>, <table>) should call find_model for each of the table hashes with plain factory name and return the models" do
expect(self).to receive(:find_model).with("user", 'name' => "Fred").once.ordered.and_return(:fred)
expect(self).to receive(:find_model).with("user", 'name' => "Betty").once.ordered.and_return(:betty)
expect(self).to receive(:find_model).with("user", {"name" => "Fred"}).once.ordered.and_return(:fred)
expect(self).to receive(:find_model).with("user", {"name" => "Betty"}).once.ordered.and_return(:betty)
expect(find_models_from_table("users", table)).to eq([:fred, :betty])
end
end
Expand All @@ -248,14 +248,14 @@ class Model
end

it "#create_models_from_table(<plural factory>, <table>) should call create_model for each of the table hashes with labelled pickle ref" do
expect(self).to receive(:create_model).with("user \"fred\"", 'name' => "Fred").once.ordered.and_return(:fred)
expect(self).to receive(:create_model).with("user \"betty\"", 'name' => "Betty").once.ordered.and_return(:betty)
expect(self).to receive(:create_model).with("user \"fred\"", {"name" => "Fred"}).once.ordered.and_return(:fred)
expect(self).to receive(:create_model).with("user \"betty\"", {"name" => "Betty"}).once.ordered.and_return(:betty)
expect(create_models_from_table("users", table)).to eq([:fred, :betty])
end

it "#find_models_from_table(<plural factory>, <table>) should call find_model for each of the table hashes with labelled pickle ref" do
expect(self).to receive(:find_model).with("user \"fred\"", 'name' => "Fred").once.ordered.and_return(:fred)
expect(self).to receive(:find_model).with("user \"betty\"", 'name' => "Betty").once.ordered.and_return(:betty)
expect(self).to receive(:find_model).with("user \"fred\"", {"name" => "Fred"}).once.ordered.and_return(:fred)
expect(self).to receive(:find_model).with("user \"betty\"", {"name" => "Betty"}).once.ordered.and_return(:betty)
expect(find_models_from_table("users", table)).to eq([:fred, :betty])
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/pickle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
it ".config should be same object on multiple calls" do
expect(Pickle.config).to eq(Pickle.config)
end

it ".configure should configure the .config object" do
expect(Pickle.config).to receive(:foo).with(:bar)
Pickle.configure do |c|
Expand All @@ -14,10 +14,10 @@

it ".parser should create a parser with the default config" do
Pickle.instance_variable_set('@parser', nil)
expect(Pickle::Parser).to receive(:new).with(:config => Pickle.config)
expect(Pickle::Parser).to receive(:new).with({:config => Pickle.config})
Pickle.parser
end

it ".parser should be same object on multiple calls" do
expect(Pickle.parser).to eq(Pickle.parser)
end
Expand Down

0 comments on commit a2b62ce

Please sign in to comment.