update to 5.1.0
This commit is contained in:
parent
d8f3196046
commit
482ef90c14
@ -1,26 +0,0 @@
|
||||
From 532bdf51581c75060f45e0d7ab52423c09b4eea1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||
Date: Mon, 8 Feb 2021 15:36:20 +0100
|
||||
Subject: [PATCH] Accept (double)quotes when removing bootsnap.
|
||||
|
||||
https://github.com/rails/rails/commit/3e0cdbeaf4e769ebd356a2c06dfae13d22283b7c
|
||||
---
|
||||
spec/support/unit/rails_application.rb | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/spec/support/unit/rails_application.rb b/spec/support/unit/rails_application.rb
|
||||
index 2f5d5dc7..3b4b02b0 100644
|
||||
--- a/spec/support/unit/rails_application.rb
|
||||
+++ b/spec/support/unit/rails_application.rb
|
||||
@@ -130,7 +130,7 @@ end
|
||||
# Zeus anyhow)
|
||||
fs.comment_lines_matching(
|
||||
'config/boot.rb',
|
||||
- %r{\Arequire 'bootsnap/setup'},
|
||||
+ %r{\Arequire ['"]bootsnap/setup['"]},
|
||||
)
|
||||
end
|
||||
|
||||
--
|
||||
2.30.0
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
From 84aff7aa2d9e5edaef43e980592e96d0fd03ce7c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||
Date: Tue, 9 Feb 2021 19:06:19 +0100
|
||||
Subject: [PATCH] Disable CPK test cases due to Rails 6.1 compatibility.
|
||||
|
||||
Relates #1396.
|
||||
---
|
||||
.../matchers/active_record/association_matcher_spec.rb | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb b/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb
|
||||
index 290deb0b..1e1d2444 100644
|
||||
--- a/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb
|
||||
+++ b/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb
|
||||
@@ -1446,6 +1446,8 @@ Expected Parent to have a has_many association called children through conceptio
|
||||
end
|
||||
|
||||
it 'rejects an association with a valid :class_name and :foreign_key option (CPK), but no columns' do
|
||||
+ pending "Rails 6.1 compatibilty"
|
||||
+
|
||||
define_model :person_detail
|
||||
define_model :person do
|
||||
has_one :detail, class_name: 'PersonDetail', foreign_key: %i[company_id person_detail_id]
|
||||
@@ -1461,6 +1463,8 @@ Expected Parent to have a has_many association called children through conceptio
|
||||
end
|
||||
|
||||
it 'accepts an association with a valid :class_name and :foreign_key option (CPK)' do
|
||||
+ pending "Rails 6.1 compatibility"
|
||||
+
|
||||
define_model :person_detail, company_id: :integer, person_detail_id: :integer
|
||||
define_model :person do
|
||||
has_one :detail, class_name: 'PersonDetail', foreign_key: %i[company_id person_detail_id]
|
||||
--
|
||||
2.30.0
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
From ee069af88dd32821c83126a73bc426a30237972c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||
Date: Tue, 9 Feb 2021 16:13:41 +0100
|
||||
Subject: [PATCH] Disable test failing due to changes in Rails 6.1.
|
||||
|
||||
---
|
||||
spec/unit/shoulda/matchers/active_model/helpers_spec.rb | 2 ++
|
||||
.../shoulda/matchers/active_record/association_matcher_spec.rb | 2 ++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/spec/unit/shoulda/matchers/active_model/helpers_spec.rb b/spec/unit/shoulda/matchers/active_model/helpers_spec.rb
|
||||
index 8246997c..1f508e3f 100644
|
||||
--- a/spec/unit/shoulda/matchers/active_model/helpers_spec.rb
|
||||
+++ b/spec/unit/shoulda/matchers/active_model/helpers_spec.rb
|
||||
@@ -81,6 +81,8 @@ describe Shoulda::Matchers::ActiveModel::Helpers do
|
||||
|
||||
context 'if ActiveModel::Errors#generate_message behavior has changed' do
|
||||
it 'provides the right error message for validate_presence_of' do
|
||||
+ pending "Rails 6.1 change?"
|
||||
+
|
||||
stub_active_model_message_generation(
|
||||
type: :blank,
|
||||
message: 'Behavior has diverged.',
|
||||
diff --git a/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb b/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb
|
||||
index 2ad3c1d1..290deb0b 100644
|
||||
--- a/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb
|
||||
+++ b/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb
|
||||
@@ -983,6 +983,8 @@ Expected Parent to have a has_many association called children through conceptio
|
||||
end
|
||||
|
||||
it 'accepts an association with a valid :source option' do
|
||||
+ pending "Rails 6.1 require :through option"
|
||||
+
|
||||
expect(having_many_children(source: :user)).
|
||||
to have_many(:children).source(:user)
|
||||
end
|
||||
--
|
||||
2.30.0
|
||||
|
||||
@ -1,337 +0,0 @@
|
||||
From 8a4efb6a6da140a001144fffc7042f15f601c991 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||
Date: Tue, 9 Feb 2021 16:09:45 +0100
|
||||
Subject: [PATCH] Fix keyword arguments for Ruby 3.0 compatibility.
|
||||
|
||||
---
|
||||
.../unit/active_record/create_table.rb | 2 +-
|
||||
spec/support/unit/helpers/model_builder.rb | 24 +++++++--------
|
||||
.../validate_inclusion_of_matcher_spec.rb | 30 +++++++++----------
|
||||
.../active_record/association_matcher_spec.rb | 20 ++++++-------
|
||||
.../have_db_column_matcher_spec.rb | 2 +-
|
||||
.../have_db_index_matcher_spec.rb | 2 +-
|
||||
6 files changed, 40 insertions(+), 40 deletions(-)
|
||||
|
||||
diff --git a/spec/support/unit/active_record/create_table.rb b/spec/support/unit/active_record/create_table.rb
|
||||
index a80ac444..e12a409c 100644
|
||||
--- a/spec/support/unit/active_record/create_table.rb
|
||||
+++ b/spec/support/unit/active_record/create_table.rb
|
||||
@@ -125,7 +125,7 @@ module UnitTests
|
||||
)
|
||||
end
|
||||
|
||||
- table.column(column_name, column_type, column_options)
|
||||
+ table.column(column_name, column_type, **column_options)
|
||||
end
|
||||
end
|
||||
end
|
||||
diff --git a/spec/support/unit/helpers/model_builder.rb b/spec/support/unit/helpers/model_builder.rb
|
||||
index 4a7fae83..036ae9a0 100644
|
||||
--- a/spec/support/unit/helpers/model_builder.rb
|
||||
+++ b/spec/support/unit/helpers/model_builder.rb
|
||||
@@ -2,24 +2,24 @@ require_relative 'class_builder'
|
||||
|
||||
module UnitTests
|
||||
module ModelBuilder
|
||||
- def create_table(*args, &block)
|
||||
- ModelBuilder.create_table(*args, &block)
|
||||
+ def create_table(*args, **options, &block)
|
||||
+ ModelBuilder.create_table(*args, **options, &block)
|
||||
end
|
||||
|
||||
- def define_model(*args, &block)
|
||||
- ModelBuilder.define_model(*args, &block)
|
||||
+ def define_model(*args, **options, &block)
|
||||
+ ModelBuilder.define_model(*args, **options, &block)
|
||||
end
|
||||
|
||||
- def define_model_instance(*args, &block)
|
||||
- define_model(*args, &block).new
|
||||
+ def define_model_instance(*args, **options, &block)
|
||||
+ define_model(*args, **options, &block).new
|
||||
end
|
||||
|
||||
- def define_model_class(*args, &block)
|
||||
- ModelBuilder.define_model_class(*args, &block)
|
||||
+ def define_model_class(*args, **options, &block)
|
||||
+ ModelBuilder.define_model_class(*args, **options, &block)
|
||||
end
|
||||
|
||||
- def define_active_model_class(*args, &block)
|
||||
- ModelBuilder.define_active_model_class(*args, &block)
|
||||
+ def define_active_model_class(*args, **options, &block)
|
||||
+ ModelBuilder.define_active_model_class(*args, **options, &block)
|
||||
end
|
||||
|
||||
class << self
|
||||
@@ -38,13 +38,13 @@ module UnitTests
|
||||
defined_models.clear
|
||||
end
|
||||
|
||||
- def create_table(table_name, options = {}, &block)
|
||||
+ def create_table(table_name, **options, &block)
|
||||
connection =
|
||||
options.delete(:connection) || DevelopmentRecord.connection
|
||||
|
||||
begin
|
||||
connection.execute("DROP TABLE IF EXISTS #{table_name}")
|
||||
- connection.create_table(table_name, options, &block)
|
||||
+ connection.create_table(table_name, **options, &block)
|
||||
created_tables << table_name
|
||||
connection
|
||||
rescue StandardError => e
|
||||
diff --git a/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb b/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb
|
||||
index 733d28ee..811ff456 100644
|
||||
--- a/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb
|
||||
+++ b/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb
|
||||
@@ -21,7 +21,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
|
||||
def build_object(**options, &block)
|
||||
build_object_with_generic_attribute(
|
||||
- options.merge(column_type: :integer, value: 1),
|
||||
+ **options.merge(column_type: :integer, value: 1),
|
||||
&block
|
||||
)
|
||||
end
|
||||
@@ -45,7 +45,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
|
||||
def build_object(**options, &block)
|
||||
build_object_with_generic_attribute(
|
||||
- options.merge(
|
||||
+ **options.merge(
|
||||
column_type: :integer,
|
||||
column_options: { limit: 2 },
|
||||
value: 1,
|
||||
@@ -71,7 +71,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
|
||||
def build_object(**options, &block)
|
||||
build_object_with_generic_attribute(
|
||||
- options.merge(column_type: :float, value: 1.0),
|
||||
+ **options.merge(column_type: :float, value: 1.0),
|
||||
&block
|
||||
)
|
||||
end
|
||||
@@ -99,7 +99,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
|
||||
def build_object(**options, &block)
|
||||
build_object_with_generic_attribute(
|
||||
- options.merge(column_type: :decimal, value: BigDecimal('1.0')),
|
||||
+ **options.merge(column_type: :decimal, value: BigDecimal('1.0')),
|
||||
&block
|
||||
)
|
||||
end
|
||||
@@ -130,7 +130,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
|
||||
define_method :build_object do |options = {}, &block|
|
||||
build_object_with_generic_attribute(
|
||||
- options.merge(column_type: :date, value: today),
|
||||
+ **options.merge(column_type: :date, value: today),
|
||||
&block
|
||||
)
|
||||
end
|
||||
@@ -158,7 +158,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
|
||||
define_method :build_object do |options = {}, &block|
|
||||
build_object_with_generic_attribute(
|
||||
- options.merge(column_type: :datetime, value: now),
|
||||
+ **options.merge(column_type: :datetime, value: now),
|
||||
&block
|
||||
)
|
||||
end
|
||||
@@ -186,7 +186,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
|
||||
define_method :build_object do |options = {}, &block|
|
||||
build_object_with_generic_attribute(
|
||||
- options.merge(column_type: :time, value: default_time),
|
||||
+ **options.merge(column_type: :time, value: default_time),
|
||||
&block
|
||||
)
|
||||
end
|
||||
@@ -207,7 +207,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
|
||||
def build_object(**options, &block)
|
||||
build_object_with_generic_attribute(
|
||||
- options.merge(column_type: :string),
|
||||
+ **options.merge(column_type: :string),
|
||||
&block
|
||||
)
|
||||
end
|
||||
@@ -798,7 +798,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
|
||||
define_method :build_object do |options = {}, &block|
|
||||
build_object_with_generic_attribute(
|
||||
- options.merge(column_type: :timestamp, value: now),
|
||||
+ **options.merge(column_type: :timestamp, value: now),
|
||||
&block
|
||||
)
|
||||
end
|
||||
@@ -842,7 +842,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
|
||||
def build_object(**options, &block)
|
||||
super(
|
||||
- options.merge(column_options: { null: true }, value: true),
|
||||
+ **options.merge(column_options: { null: true }, value: true),
|
||||
&block
|
||||
)
|
||||
end
|
||||
@@ -863,13 +863,13 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
end
|
||||
|
||||
def build_object(**options, &block)
|
||||
- super(options.merge(column_options: { null: false }), &block)
|
||||
+ super(**options.merge(column_options: { null: false }), &block)
|
||||
end
|
||||
end
|
||||
|
||||
def build_object(**options, &block)
|
||||
build_object_with_generic_attribute(
|
||||
- options.merge(column_type: :boolean),
|
||||
+ **options.merge(column_type: :boolean),
|
||||
&block
|
||||
)
|
||||
end
|
||||
@@ -896,7 +896,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
include_context 'against a boolean attribute for true and false'
|
||||
|
||||
def build_object(**options, &block)
|
||||
- build_object_with_generic_attribute(options.merge(value: true), &block)
|
||||
+ build_object_with_generic_attribute(**options.merge(value: true), &block)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -904,7 +904,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
include_context 'against a boolean attribute for true and false'
|
||||
|
||||
def build_object(**options, &block)
|
||||
- build_object_with_generic_attribute(options.merge(value: false), &block)
|
||||
+ build_object_with_generic_attribute(**options.merge(value: false), &block)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1010,7 +1010,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||
column_options: column_options,
|
||||
}.compact
|
||||
|
||||
- define_simple_model(model_options) do |model|
|
||||
+ define_simple_model(**model_options) do |model|
|
||||
if validation_options
|
||||
model.validates_inclusion_of(attribute_name, validation_options)
|
||||
end
|
||||
diff --git a/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb b/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb
|
||||
index 1136fdf6..2ad3c1d1 100644
|
||||
--- a/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb
|
||||
+++ b/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb
|
||||
@@ -809,10 +809,10 @@ describe Shoulda::Matchers::ActiveRecord::AssociationMatcher, type: :model do
|
||||
parent_options = {},
|
||||
&block
|
||||
)
|
||||
- define_model(:parent, parent_options)
|
||||
+ define_model(:parent, **parent_options)
|
||||
|
||||
define_model :child, parent_id: :integer do
|
||||
- belongs_to :parent, options
|
||||
+ belongs_to :parent, **options
|
||||
|
||||
if block
|
||||
class_eval(&block)
|
||||
@@ -841,7 +841,7 @@ describe Shoulda::Matchers::ActiveRecord::AssociationMatcher, type: :model do
|
||||
|
||||
def belonging_to_non_existent_class(model_name, assoc_name, options = {})
|
||||
define_model model_name, "#{assoc_name}_id" => :integer do
|
||||
- belongs_to assoc_name, options
|
||||
+ belongs_to assoc_name, **options
|
||||
end.new
|
||||
end
|
||||
end
|
||||
@@ -1256,14 +1256,14 @@ Expected Parent to have a has_many association called children through conceptio
|
||||
order = options.delete(:order)
|
||||
define_association_with_order(model, :has_many, :children, order, options)
|
||||
else
|
||||
- model.has_many :children, options
|
||||
+ model.has_many :children, nil, **options
|
||||
end
|
||||
end.new
|
||||
end
|
||||
|
||||
def having_many_non_existent_class(model_name, assoc_name, options = {})
|
||||
define_model model_name do
|
||||
- has_many assoc_name, options
|
||||
+ has_many assoc_name, **options
|
||||
end.new
|
||||
end
|
||||
end
|
||||
@@ -1596,14 +1596,14 @@ Expected Parent to have a has_many association called children through conceptio
|
||||
order = options.delete(:order)
|
||||
define_association_with_order(model, :has_one, :detail, order, options)
|
||||
else
|
||||
- model.has_one :detail, options
|
||||
+ model.has_one :detail, **options
|
||||
end
|
||||
end.new
|
||||
end
|
||||
|
||||
def having_one_non_existent(model_name, assoc_name, options = {})
|
||||
define_model model_name do
|
||||
- has_one assoc_name, options
|
||||
+ has_one assoc_name, **options
|
||||
end.new
|
||||
end
|
||||
end
|
||||
@@ -2226,7 +2226,7 @@ Expected Person to have a has_and_belongs_to_many association called relatives (
|
||||
|
||||
def having_and_belonging_to_many_non_existent_class(model_name, assoc_name, options = {})
|
||||
define_model model_name do
|
||||
- has_and_belongs_to_many assoc_name, options
|
||||
+ has_and_belongs_to_many assoc_name, **options
|
||||
end.new
|
||||
end
|
||||
end
|
||||
@@ -2238,8 +2238,8 @@ Expected Person to have a has_and_belongs_to_many association called relatives (
|
||||
args << proc { where(conditions) }
|
||||
else
|
||||
options[:conditions] = conditions
|
||||
+ args << options
|
||||
end
|
||||
- args << options
|
||||
model.__send__(macro, name, *args)
|
||||
end
|
||||
|
||||
@@ -2250,8 +2250,8 @@ Expected Person to have a has_and_belongs_to_many association called relatives (
|
||||
args << proc { order(order) }
|
||||
else
|
||||
options[:order] = order
|
||||
+ args << options
|
||||
end
|
||||
- args << options
|
||||
model.__send__(macro, name, *args)
|
||||
end
|
||||
|
||||
diff --git a/spec/unit/shoulda/matchers/active_record/have_db_column_matcher_spec.rb b/spec/unit/shoulda/matchers/active_record/have_db_column_matcher_spec.rb
|
||||
index 8d56315f..47ae006e 100644
|
||||
--- a/spec/unit/shoulda/matchers/active_record/have_db_column_matcher_spec.rb
|
||||
+++ b/spec/unit/shoulda/matchers/active_record/have_db_column_matcher_spec.rb
|
||||
@@ -112,7 +112,7 @@ describe Shoulda::Matchers::ActiveRecord::HaveDbColumnMatcher, type: :model do
|
||||
|
||||
def with_table(column_name, column_type, options)
|
||||
create_table 'employees' do |table|
|
||||
- table.__send__(column_type, column_name, options)
|
||||
+ table.__send__(column_type, column_name, **options)
|
||||
end
|
||||
define_model_class('Employee').new
|
||||
end
|
||||
diff --git a/spec/unit/shoulda/matchers/active_record/have_db_index_matcher_spec.rb b/spec/unit/shoulda/matchers/active_record/have_db_index_matcher_spec.rb
|
||||
index 7a0ffdea..54fe4593 100644
|
||||
--- a/spec/unit/shoulda/matchers/active_record/have_db_index_matcher_spec.rb
|
||||
+++ b/spec/unit/shoulda/matchers/active_record/have_db_index_matcher_spec.rb
|
||||
@@ -494,7 +494,7 @@ does not.
|
||||
columns,
|
||||
parent_class: parent_class,
|
||||
customize_table: -> (table) {
|
||||
- table.index(column_name_or_names, index_options)
|
||||
+ table.index(column_name_or_names, **index_options)
|
||||
},
|
||||
)
|
||||
model.new
|
||||
--
|
||||
2.30.0
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
From 937256be204487727727cecc18519d85b91201d5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ga=C3=ABtan=20Masson?= <im.gaetanmasson@gmail.com>
|
||||
Date: Thu, 28 Jan 2021 20:25:05 +0100
|
||||
Subject: [PATCH] Handle argument delegation for Ruby 3
|
||||
|
||||
---
|
||||
lib/shoulda/matchers/rails_shim.rb | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/shoulda/matchers/rails_shim.rb b/lib/shoulda/matchers/rails_shim.rb
|
||||
index b426b575a..6cecb4b0a 100644
|
||||
--- a/lib/shoulda/matchers/rails_shim.rb
|
||||
+++ b/lib/shoulda/matchers/rails_shim.rb
|
||||
@@ -65,7 +65,7 @@ def make_controller_request(context, verb, action, request_params)
|
||||
request_params
|
||||
end
|
||||
|
||||
- context.__send__(verb, action, params)
|
||||
+ context.__send__(verb, action, **params)
|
||||
end
|
||||
|
||||
def serialized_attributes_for(model)
|
||||
@ -1,24 +0,0 @@
|
||||
From d783d864251f1ab59fad22ec56b97dc2c4f30276 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||
Date: Tue, 9 Feb 2021 17:32:31 +0100
|
||||
Subject: [PATCH] Remove rack-mini-profiler dependency.
|
||||
|
||||
---
|
||||
spec/support/acceptance/helpers/step_helpers.rb | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/spec/support/acceptance/helpers/step_helpers.rb b/spec/support/acceptance/helpers/step_helpers.rb
|
||||
index ea6f5b7f..3fe7062a 100644
|
||||
--- a/spec/support/acceptance/helpers/step_helpers.rb
|
||||
+++ b/spec/support/acceptance/helpers/step_helpers.rb
|
||||
@@ -76,6 +76,7 @@ module AcceptanceTests
|
||||
bundle.remove_gem 'debugger'
|
||||
bundle.remove_gem 'byebug'
|
||||
bundle.remove_gem 'web-console'
|
||||
+ bundle.remove_gem 'rack-mini-profiler'
|
||||
bundle.add_gem 'pg'
|
||||
end
|
||||
|
||||
--
|
||||
2.30.0
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
From c52f0483ab803fb7db6af20bf6bc80890af8d504 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Nichols <josh.nichols@gusto.com>
|
||||
Date: Sat, 29 Jan 2022 11:01:02 -0500
|
||||
Subject: [PATCH] Address differences in has_secure_password in Rails 7+
|
||||
|
||||
---
|
||||
.../validate_presence_of_matcher_spec.rb | 40 +++++++++++++------
|
||||
1 file changed, 28 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb b/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb
|
||||
index 818a57320..5c7841e67 100644
|
||||
--- a/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb
|
||||
+++ b/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb
|
||||
@@ -860,22 +860,38 @@ def record_belonging_to(
|
||||
end
|
||||
|
||||
context 'against a pre-set password in a model that has_secure_password' do
|
||||
- it 'raises a CouldNotSetPasswordError' do
|
||||
- user_class = define_model :user, password_digest: :string do
|
||||
- has_secure_password validations: false
|
||||
- validates_presence_of :password
|
||||
- end
|
||||
+ if Shoulda::Matchers::RailsShim.active_model_lt_7?
|
||||
+ it 'raises a CouldNotSetPasswordError' do
|
||||
+ user_class = define_model :user, password_digest: :string do
|
||||
+ has_secure_password :password, validations: false
|
||||
+ validates_presence_of :password
|
||||
+ end
|
||||
|
||||
- user = user_class.new
|
||||
- user.password = 'something'
|
||||
+ user = user_class.new
|
||||
+ user.password = 'something'
|
||||
|
||||
- assertion = lambda do
|
||||
- expect(user).to validate_presence_of(:password)
|
||||
+ assertion = lambda do
|
||||
+ expect(user).to validate_presence_of(:password)
|
||||
+ end
|
||||
+
|
||||
+ expect(&assertion).to raise_error(
|
||||
+ Shoulda::Matchers::ActiveModel::CouldNotSetPasswordError,
|
||||
+ )
|
||||
end
|
||||
+ else
|
||||
+ it 'does not raises a CouldNotSetPasswordError' do
|
||||
+ user_class = define_model :user, password_digest: :string do
|
||||
+ has_secure_password :password, validations: false
|
||||
+ validates_presence_of :password
|
||||
+ end
|
||||
|
||||
- expect(&assertion).to raise_error(
|
||||
- Shoulda::Matchers::ActiveModel::CouldNotSetPasswordError,
|
||||
- )
|
||||
+ user = user_class.new
|
||||
+ user.password = 'something'
|
||||
+
|
||||
+ assertion = lambda do
|
||||
+ expect(user).to validate_presence_of(:password)
|
||||
+ end
|
||||
+ end
|
||||
end
|
||||
end
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
From c52f0483ab803fb7db6af20bf6bc80890af8d504 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Nichols <josh.nichols@gusto.com>
|
||||
Date: Sat, 29 Jan 2022 11:01:02 -0500
|
||||
Subject: [PATCH] Address differences in has_secure_password in Rails 7+
|
||||
|
||||
---
|
||||
.../validate_presence_of_matcher.rb | 4 +-
|
||||
lib/shoulda/matchers/rails_shim.rb | 10 +++++
|
||||
2 files changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb b/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb
|
||||
index c23302091..0c93bc3af 100644
|
||||
--- a/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb
|
||||
+++ b/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb
|
||||
@@ -144,7 +144,7 @@ def matches?(subject)
|
||||
|
||||
possibly_ignore_interference_by_writer
|
||||
|
||||
- if secure_password_being_validated?
|
||||
+ if secure_password_being_validated? && Shoulda::Matchers::RailsShim.active_model_lt_7?
|
||||
ignore_interference_by_writer.default_to(when: :blank?)
|
||||
|
||||
disallowed_values.all? do |value|
|
||||
@@ -208,7 +208,7 @@ def secure_password_being_validated?
|
||||
end
|
||||
|
||||
def possibly_ignore_interference_by_writer
|
||||
- if secure_password_being_validated?
|
||||
+ if secure_password_being_validated? && RailsShim.active_model_lt_7?
|
||||
ignore_interference_by_writer.default_to(when: :blank?)
|
||||
end
|
||||
end
|
||||
diff --git a/lib/shoulda/matchers/rails_shim.rb b/lib/shoulda/matchers/rails_shim.rb
|
||||
index 2474d7363..c328d9e90 100644
|
||||
--- a/lib/shoulda/matchers/rails_shim.rb
|
||||
+++ b/lib/shoulda/matchers/rails_shim.rb
|
||||
@@ -19,6 +19,16 @@ def active_record_version
|
||||
Gem::Version.new('0')
|
||||
end
|
||||
|
||||
+ def active_model_version
|
||||
+ Gem::Version.new(::ActiveModel::VERSION::STRING)
|
||||
+ rescue NameError
|
||||
+ Gem::Version.new('0')
|
||||
+ end
|
||||
+
|
||||
+ def active_model_lt_7?
|
||||
+ Gem::Requirement.new('< 7').satisfied_by?(active_model_version)
|
||||
+ end
|
||||
+
|
||||
def generate_validation_message(
|
||||
record,
|
||||
attribute,
|
||||
28
rubygem-shoulda-matchers-5.1.0-Always-use-sqlite-1.4.patch
Normal file
28
rubygem-shoulda-matchers-5.1.0-Always-use-sqlite-1.4.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 7656cdf9abb4a0f7c4fd4cb9c971e474bfc0f9ee Mon Sep 17 00:00:00 2001
|
||||
From: Josh Nichols <josh.nichols@gusto.com>
|
||||
Date: Tue, 25 Jan 2022 13:35:35 -0500
|
||||
Subject: [PATCH] Always use sqlite ~> 1.4
|
||||
|
||||
Rails 5.2 changed at some point to not specify a version. < 1.4 of
|
||||
sqlite fails to build on Apple M1s.
|
||||
---
|
||||
spec/support/acceptance/helpers/step_helpers.rb | 6 +-----
|
||||
1 file changed, 1 insertion(+), 5 deletions(-)
|
||||
|
||||
diff --git a/spec/support/acceptance/helpers/step_helpers.rb b/spec/support/acceptance/helpers/step_helpers.rb
|
||||
index fa972ecf4..530133fc5 100644
|
||||
--- a/spec/support/acceptance/helpers/step_helpers.rb
|
||||
+++ b/spec/support/acceptance/helpers/step_helpers.rb
|
||||
@@ -23,11 +23,7 @@ def create_active_record_project
|
||||
add_gem 'activerecord', active_record_version
|
||||
add_gem 'rake'
|
||||
|
||||
- if rails_version =~ '~> 6.0'
|
||||
- add_gem 'sqlite3', '~>1.4'
|
||||
- else
|
||||
- add_gem 'sqlite3', '~>1.3.6'
|
||||
- end
|
||||
+ add_gem 'sqlite3', '~>1.4'
|
||||
end
|
||||
|
||||
def create_generic_bundler_project
|
||||
@ -0,0 +1,24 @@
|
||||
From 0212a6e2f15214c34ea6015ea9a2718fcc24ee66 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Nichols <josh.nichols@gusto.com>
|
||||
Date: Tue, 25 Jan 2022 11:16:07 -0500
|
||||
Subject: [PATCH] Only mark classes as unloadable when Rails supports it
|
||||
|
||||
Rails 7.0 drops "classic" mode in favor of zeitwerk. The unloadable
|
||||
method is no longer available.
|
||||
---
|
||||
spec/support/unit/helpers/class_builder.rb | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/spec/support/unit/helpers/class_builder.rb b/spec/support/unit/helpers/class_builder.rb
|
||||
index c7e294b86..f73fe2e3a 100644
|
||||
--- a/spec/support/unit/helpers/class_builder.rb
|
||||
+++ b/spec/support/unit/helpers/class_builder.rb
|
||||
@@ -55,7 +55,7 @@ class #{namespace}::#{name_without_namespace} < ::#{parent_class}
|
||||
RUBY
|
||||
|
||||
namespace.const_get(name_without_namespace).tap do |constant|
|
||||
- constant.unloadable
|
||||
+ constant.unloadable if constant.respond_to?(:unloadable) # if Rails is in classic mode, mark it unloadable
|
||||
@_defined_modules = defined_modules | [constant]
|
||||
|
||||
if block
|
||||
@ -0,0 +1,138 @@
|
||||
From 8e1303957ba2c0828c2eb2b91b9edea723d1553d Mon Sep 17 00:00:00 2001
|
||||
From: Neil <me@neil.pro>
|
||||
Date: Sat, 15 Jan 2022 19:37:42 -0300
|
||||
Subject: [PATCH 1/3] Skip bootsnap on the test project creation
|
||||
|
||||
Use the Rails --skip-bootsnap option instead of commenting it on
|
||||
boot.rb
|
||||
---
|
||||
spec/support/acceptance/helpers/step_helpers.rb | 4 ++--
|
||||
spec/support/unit/rails_application.rb | 11 -----------
|
||||
2 files changed, 2 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/spec/support/acceptance/helpers/step_helpers.rb b/spec/support/acceptance/helpers/step_helpers.rb
|
||||
index fa972ecf4..878b27d3e 100644
|
||||
--- a/spec/support/acceptance/helpers/step_helpers.rb
|
||||
+++ b/spec/support/acceptance/helpers/step_helpers.rb
|
||||
@@ -93,9 +93,9 @@ def create_rails_application
|
||||
|
||||
def rails_new_command
|
||||
if rails_version =~ '~> 6.0'
|
||||
- "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --skip-javascript --no-rc"
|
||||
+ "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --skip-javascript --no-rc --skip-bootsnap"
|
||||
else
|
||||
- "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --no-rc"
|
||||
+ "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --no-rc --skip-bootsnap"
|
||||
end
|
||||
end
|
||||
|
||||
diff --git a/spec/support/unit/rails_application.rb b/spec/support/unit/rails_application.rb
|
||||
index b55b12cee..4480fd21a 100644
|
||||
--- a/spec/support/unit/rails_application.rb
|
||||
+++ b/spec/support/unit/rails_application.rb
|
||||
@@ -77,7 +77,6 @@ def temp_view_path_for(path)
|
||||
def generate
|
||||
rails_new
|
||||
fix_available_locales_warning
|
||||
- remove_bootsnap
|
||||
write_database_configuration
|
||||
write_activerecord_model_with_default_connection
|
||||
write_activerecord_model_with_different_connection
|
||||
@@ -124,16 +123,6 @@ def fix_available_locales_warning
|
||||
end
|
||||
end
|
||||
|
||||
- def remove_bootsnap
|
||||
- # Rails 5.2 introduced bootsnap, which is helpful when you're developing
|
||||
- # or deploying an app, but we don't really need it (and it messes with
|
||||
- # Zeus anyhow)
|
||||
- fs.comment_lines_matching(
|
||||
- 'config/boot.rb',
|
||||
- %r{\Arequire 'bootsnap/setup'},
|
||||
- )
|
||||
- end
|
||||
-
|
||||
def write_database_configuration
|
||||
YAML.dump(database.config.load_file, fs.open('config/database.yml', 'w'))
|
||||
end
|
||||
|
||||
From df9c312134a939ab1c220b071d95fe3e32fe2601 Mon Sep 17 00:00:00 2001
|
||||
From: Neil <me@neil.pro>
|
||||
Date: Wed, 19 Jan 2022 07:32:15 -0300
|
||||
Subject: [PATCH 2/3] Use the same `rails new` command on acceptance and unit
|
||||
tests
|
||||
|
||||
---
|
||||
spec/support/unit/rails_application.rb | 19 ++-----------------
|
||||
1 file changed, 2 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/spec/support/unit/rails_application.rb b/spec/support/unit/rails_application.rb
|
||||
index 4480fd21a..511b99960 100644
|
||||
--- a/spec/support/unit/rails_application.rb
|
||||
+++ b/spec/support/unit/rails_application.rb
|
||||
@@ -90,24 +90,9 @@ def rails_new
|
||||
|
||||
def rails_new_command
|
||||
if rails_version > 5
|
||||
- [
|
||||
- 'rails',
|
||||
- 'new',
|
||||
- fs.project_directory.to_s,
|
||||
- "--database=#{database.adapter_name}",
|
||||
- '--skip-bundle',
|
||||
- '--no-rc',
|
||||
- '--skip-webpack-install',
|
||||
- ]
|
||||
+ "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --skip-javascript --no-rc --skip-bootsnap"
|
||||
else
|
||||
- [
|
||||
- 'rails',
|
||||
- 'new',
|
||||
- fs.project_directory.to_s,
|
||||
- "--database=#{database.adapter_name}",
|
||||
- '--skip-bundle',
|
||||
- '--no-rc',
|
||||
- ]
|
||||
+ "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --no-rc --skip-bootsnap"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
From 2f9c975c77e8adf1ebb2f0fe921756a9527e504c Mon Sep 17 00:00:00 2001
|
||||
From: Neil <me@neil.pro>
|
||||
Date: Wed, 19 Jan 2022 07:32:57 -0300
|
||||
Subject: [PATCH 3/3] Fix the Rails version comparison
|
||||
|
||||
The `=~ '~> 6.0'` comparison is evaluated to `false` on newer
|
||||
versions of Rails, thus not skipping the JavaScript dependencies.
|
||||
---
|
||||
spec/support/acceptance/helpers/step_helpers.rb | 2 +-
|
||||
spec/support/unit/rails_application.rb | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/spec/support/acceptance/helpers/step_helpers.rb b/spec/support/acceptance/helpers/step_helpers.rb
|
||||
index 878b27d3e..818b08842 100644
|
||||
--- a/spec/support/acceptance/helpers/step_helpers.rb
|
||||
+++ b/spec/support/acceptance/helpers/step_helpers.rb
|
||||
@@ -92,7 +92,7 @@ def create_rails_application
|
||||
end
|
||||
|
||||
def rails_new_command
|
||||
- if rails_version =~ '~> 6.0'
|
||||
+ if rails_version >= 6.0
|
||||
"bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --skip-javascript --no-rc --skip-bootsnap"
|
||||
else
|
||||
"bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --no-rc --skip-bootsnap"
|
||||
diff --git a/spec/support/unit/rails_application.rb b/spec/support/unit/rails_application.rb
|
||||
index 511b99960..5f097099d 100644
|
||||
--- a/spec/support/unit/rails_application.rb
|
||||
+++ b/spec/support/unit/rails_application.rb
|
||||
@@ -89,7 +89,7 @@ def rails_new
|
||||
end
|
||||
|
||||
def rails_new_command
|
||||
- if rails_version > 5
|
||||
+ if rails_version >= 6.0
|
||||
"bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --skip-javascript --no-rc --skip-bootsnap"
|
||||
else
|
||||
"bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --no-rc --skip-bootsnap"
|
||||
@ -0,0 +1,42 @@
|
||||
From a1431b9859e8b8bc6810cf98687ab4c382d0adcf Mon Sep 17 00:00:00 2001
|
||||
From: Josh Nichols <joshua.nichols@gmail.com>
|
||||
Date: Mon, 31 Jan 2022 20:56:53 +0000
|
||||
Subject: [PATCH] Use a hard-coded DateTime instead of DateTime.now. This
|
||||
avoids some differences in Rails 7.0, where it can return nanoseconds,
|
||||
leading things to be not quiete equal
|
||||
|
||||
---
|
||||
.../active_model/validate_inclusion_of_matcher_spec.rb | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb b/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb
|
||||
index 80599530c..dd9b7933c 100644
|
||||
--- a/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb
|
||||
+++ b/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb
|
||||
@@ -145,7 +145,7 @@ def validation_matcher_scenario_args
|
||||
end
|
||||
|
||||
context 'against a datetime attribute' do
|
||||
- now = DateTime.now
|
||||
+ now = DateTime.new(2022, 01, 01)
|
||||
|
||||
define_method(:now) { now }
|
||||
|
||||
@@ -448,6 +448,7 @@ def configure_validation_matcher(matcher)
|
||||
end
|
||||
|
||||
it 'matches given the same array of valid values' do
|
||||
+ new_now = DateTime.now
|
||||
builder = build_object_allowing(possible_values)
|
||||
expect_to_match_on_values(builder, possible_values)
|
||||
end
|
||||
@@ -785,8 +786,7 @@ def configure_validation_matcher(matcher)
|
||||
include_context 'for a generic attribute'
|
||||
|
||||
context 'against a timestamp column' do
|
||||
- now = DateTime.now
|
||||
-
|
||||
+ now = DateTime.new(2022, 01, 01)
|
||||
define_method(:now) { now }
|
||||
|
||||
it_behaves_like 'it supports in_array',
|
||||
@ -0,0 +1,22 @@
|
||||
From e0ebc2b16afc09804112a84213fdc83305427d3a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||
Date: Tue, 23 Aug 2022 11:34:29 +0200
|
||||
Subject: [PATCH] Using local gems should be enough for testing
|
||||
|
||||
---
|
||||
spec/support/acceptance/helpers/step_helpers.rb | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/spec/support/acceptance/helpers/step_helpers.rb b/spec/support/acceptance/helpers/step_helpers.rb
|
||||
index 529f97fc3..73a5b3250 100644
|
||||
--- a/spec/support/acceptance/helpers/step_helpers.rb
|
||||
+++ b/spec/support/acceptance/helpers/step_helpers.rb
|
||||
@@ -116,7 +116,7 @@ def add_rspec_to_project
|
||||
|
||||
def add_rspec_rails_to_project!
|
||||
add_gem 'rspec-rails', rspec_rails_version
|
||||
- run_command_within_bundle!('bundle install --binstubs') if rails_gt_6_0?
|
||||
+ run_command_within_bundle!('bundle install --local --binstubs') if rails_gt_6_0?
|
||||
run_command_within_bundle!('rails g rspec:install')
|
||||
remove_from_file '.rspec', '--warnings'
|
||||
end
|
||||
@ -0,0 +1,22 @@
|
||||
From 4a2702e5a0b18cb86a8bb0d52616a44f1ef70852 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Nichols <josh.nichols@gusto.com>
|
||||
Date: Wed, 26 Jan 2022 08:52:44 -0500
|
||||
Subject: [PATCH] conditionally use unloadable in another spot
|
||||
|
||||
---
|
||||
spec/support/unit/helpers/class_builder.rb | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/spec/support/unit/helpers/class_builder.rb b/spec/support/unit/helpers/class_builder.rb
|
||||
index f73fe2e3a..569aca74d 100644
|
||||
--- a/spec/support/unit/helpers/class_builder.rb
|
||||
+++ b/spec/support/unit/helpers/class_builder.rb
|
||||
@@ -34,7 +34,7 @@ module #{namespace}::#{name_without_namespace}
|
||||
RUBY
|
||||
|
||||
namespace.const_get(name_without_namespace).tap do |constant|
|
||||
- constant.unloadable
|
||||
+ constant.unloadable if constant.respond_to?(:unloadable) # if Rails is in classic mode, mark it unloadable
|
||||
@_defined_modules = defined_modules | [constant]
|
||||
|
||||
if block
|
||||
@ -1,30 +1,39 @@
|
||||
%global gem_name shoulda-matchers
|
||||
Name: rubygem-%{gem_name}
|
||||
Version: 4.5.1
|
||||
Version: 5.1.0
|
||||
Release: 1
|
||||
Summary: Making tests easy on the fingers and eyes
|
||||
License: MIT
|
||||
URL: https://github.com/thoughtbot/shoulda-matchers
|
||||
Source0: https://rubygems.org/gems/shoulda-matchers-%{version}.gem
|
||||
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||||
# git clone https://github.com/thoughtbot/shoulda-matchers.git && cd shoulda-matchers
|
||||
# git archive -v -o shoulda-matchers-4.5.1-specs.tar.gz v4.5.1 spec/
|
||||
Source1: shoulda-matchers-4.5.1-specs.tar.gz
|
||||
# git archive -v -o shoulda-matchers-5.1.0-specs.tar.gz v5.1.0 spec/
|
||||
Source1: %{gem_name}-%{version}-specs.tar.gz
|
||||
# Fix bootsnap removal which is not enclosed in quotes.
|
||||
# https://github.com/thoughtbot/shoulda-matchers/pull/1410
|
||||
Patch0: rubygem-shoulda-matchers-4.5.1-Remove-rack-mini-profiler-dependency.patch
|
||||
Patch1: rubygem-shoulda-matchers-4.1.2-Accept-double-quotes-when-removing-bootsnap.patch
|
||||
Patch2: rubygem-shoulda-matchers-4.5.1-Fix-keyword-arguments-for-Ruby-3.0-compatibility.patch
|
||||
Patch3: rubygem-shoulda-matchers-4.5.1-Disable-test-failing-due-to-changes-in-Rails-6.1.patch
|
||||
Patch4: rubygem-shoulda-matchers-4.5.1-Disable-CPK-test-cases-due-to-Rails-6.1-compatibilit.patch
|
||||
# Fix kwargs for Ruby 3.
|
||||
# https://github.com/thoughtbot/shoulda-matchers/pull/1406
|
||||
Patch5: rubygem-shoulda-matchers-4.5.1-Handle-argument-delegation-for-Ruby-3.patch
|
||||
# https://github.com/thoughtbot/shoulda-matchers/pull/1478
|
||||
Patch0: rubygem-shoulda-matchers-5.1.0-Skip-bootsnap-on-the-test-project-creation.patch
|
||||
|
||||
BuildRequires: ruby(release) rubygems-devel ruby rubygem(activeresource) rubygem(bcrypt)
|
||||
BuildRequires: rubygem(jbuilder) rubygem(minitest-reporters) rubygem(rails)
|
||||
BuildRequires: rubygem(rails-controller-testing) rubygem(rspec) rubygem(rspec-rails)
|
||||
# Fix RoR 7+ compatibility.
|
||||
# https://github.com/thoughtbot/shoulda-matchers/pull/1485
|
||||
Patch1: rubygem-shoulda-matchers-5.1.0-Only-mark-classes-as-unloadable-when-Rails-supports-it.patch
|
||||
Patch2: rubygem-shoulda-matchers-5.1.0-conditionally-use-unloadable-in-another-spot.patch
|
||||
Patch3: rubygem-shoulda-matchers-5.1.0-Use-a-hard-coded-DateTime-instead-of-DateTime.now-1.patch
|
||||
Patch4: rubygem-shoulda-matchers-5.1.0-Address-differences-in-has_secure_password-in-Rails-7.patch
|
||||
Patch5: rubygem-shoulda-matchers-5.1.0-Address-differences-in-has_secure_password-in-Rails-7-test.patch
|
||||
|
||||
# Don't try to connect to rubygems.org.
|
||||
# https://github.com/thoughtbot/shoulda-matchers/pull/1504
|
||||
Patch6: rubygem-shoulda-matchers-5.1.0-Using-local-gems-should-be-enough-for-testing.patch
|
||||
|
||||
# Use sqlite3 1.4 unconditionally.
|
||||
# https://github.com/thoughtbot/shoulda-matchers/pull/1484/commits/7656cdf9abb4a0f7c4fd4cb9c971e474bfc0f9ee
|
||||
Patch7: rubygem-shoulda-matchers-5.1.0-Always-use-sqlite-1.4.patch
|
||||
|
||||
BuildRequires: ruby(release) rubygems-devel ruby rubygem(bcrypt) rubygem(jbuilder)
|
||||
BuildRequires: rubygem(puma) rubygem(rails) rubygem(rails-controller-testing) rubygem(rspec) rubygem(rspec-rails)
|
||||
BuildRequires: rubygem(shoulda-context) rubygem(spring) rubygem(sqlite3)
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
shoulda-matchers provides Test::Unit- and RSpec-compatible one-liners that
|
||||
test common Rails functionality. These tests would otherwise be much longer,
|
||||
@ -40,14 +49,16 @@ Documentation for %{name}.
|
||||
%prep
|
||||
%setup -q -n %{gem_name}-%{version} -b 1
|
||||
|
||||
%patch5 -p1
|
||||
%patch4 -p1
|
||||
|
||||
pushd %{_builddir}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
popd
|
||||
|
||||
%build
|
||||
@ -59,6 +70,8 @@ mkdir -p %{buildroot}%{gem_dir}
|
||||
cp -a .%{gem_dir}/* \
|
||||
%{buildroot}%{gem_dir}/
|
||||
|
||||
|
||||
|
||||
%check
|
||||
pushd .%{gem_instdir}
|
||||
ln -s %{_builddir}/spec spec
|
||||
@ -80,25 +93,33 @@ sed -i "/current_bundle/ s/^/#/" \
|
||||
sed -i "/CurrentBundle/ s/^/#/" \
|
||||
spec/acceptance_spec_helper.rb \
|
||||
spec/support/unit/load_environment.rb
|
||||
|
||||
sed -i "/def rails_new_command/,/^ end$/ {
|
||||
/\]/i\ '--skip-listen',
|
||||
}" spec/support/unit/rails_application.rb
|
||||
sed -i '/rails new/ s/"$/ --skip-bootsnap --skip-listen --skip-puma --skip-sprockets"/' \
|
||||
sed -i '/def rails_new_command/,/^ end$/ {
|
||||
/rails new/ s/"$/ --skip-git --skip-asset-pipeline&/
|
||||
}' \
|
||||
spec/support/unit/rails_application.rb
|
||||
sed -i '/def rails_new_command/,/^ end$/ {
|
||||
/rails new/ s/"$/ --skip-git --skip-asset-pipeline&/
|
||||
}' \
|
||||
spec/support/acceptance/helpers/step_helpers.rb
|
||||
sed -i '/def load_file/,/end/ s/::load_file/::unsafe_load_file/' spec/support/tests/database_configuration.rb
|
||||
|
||||
bundle exec rspec spec/unit
|
||||
sed -i "/bundle.add_gem 'pg'/ s/^/#/" spec/support/acceptance/helpers/step_helpers.rb
|
||||
|
||||
sed -i "/add_gem 'spring-commands-rspec'/ s/^/#/" spec/support/acceptance/helpers/step_helpers.rb
|
||||
sed -i "/updating_bundle do |bundle|/a \\
|
||||
bundle.add_gem 'spring'" spec/support/acceptance/helpers/step_helpers.rb
|
||||
sed -i "/updating_bundle do |bundle|/a \\
|
||||
bundle.remove_gem 'capybara'" spec/support/acceptance/helpers/step_helpers.rb
|
||||
sed -i "/updating_bundle do |bundle|/a \\
|
||||
bundle.remove_gem 'selenium-webdriver'" spec/support/acceptance/helpers/step_helpers.rb
|
||||
sed -i "/updating_bundle do |bundle|/a \\
|
||||
bundle.remove_gem 'webdrivers'" spec/support/acceptance/helpers/step_helpers.rb
|
||||
DISABLE_SPRING=true bundle exec rspec spec/acceptance
|
||||
bundle.remove_gem 'debug'" spec/support/acceptance/helpers/step_helpers.rb
|
||||
|
||||
bundle exec rspec spec/acceptance
|
||||
|
||||
popd
|
||||
|
||||
|
||||
%files
|
||||
%dir %{gem_instdir}
|
||||
%license %{gem_instdir}/LICENSE
|
||||
@ -113,6 +134,9 @@ popd
|
||||
%{gem_instdir}/shoulda-matchers.gemspec
|
||||
|
||||
%changelog
|
||||
* Tue Jan 17 2023 wulei <wulei80@h-partners.com> - 5.1.0-1
|
||||
- update to 5.1.0
|
||||
|
||||
* Wed Jun 29 2022 liyanan <liyanan32@h-partners.com> - 4.5.1-1
|
||||
- Upgrade to version 4.5.1
|
||||
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
git_url: https://github.com/thoughtbot/shoulda-matchers.git
|
||||
version_control: github
|
||||
src_repo: thoughtbot/shoulda-matchers
|
||||
tag_prefix: "^v"
|
||||
seperator: "."
|
||||
Binary file not shown.
Binary file not shown.
BIN
shoulda-matchers-5.1.0-specs.tar.gz
Normal file
BIN
shoulda-matchers-5.1.0-specs.tar.gz
Normal file
Binary file not shown.
BIN
shoulda-matchers-5.1.0.gem
Normal file
BIN
shoulda-matchers-5.1.0.gem
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user