From 621c2c4271edc49539e811d1705b65537c022734 Mon Sep 17 00:00:00 2001 From: bivanalhar Date: Fri, 28 Jun 2024 11:59:06 +0800 Subject: [PATCH] chore(dep): update rspec version for each rails ver --- .github/workflows/ruby.yml | 2 +- Appraisals | 7 +++---- activerecord-userstamp.gemspec | 1 - gemfiles/rails_6.0.gemfile | 7 ------- gemfiles/rails_6.1.gemfile | 1 + gemfiles/rails_7.0.gemfile | 1 + gemfiles/rails_7.1.gemfile | 1 + spec/lib/migration_spec.rb | 11 +++++------ 8 files changed, 12 insertions(+), 19 deletions(-) delete mode 100644 gemfiles/rails_6.0.gemfile diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index b8674da..adeec94 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: ruby-version: ['3.0', '3.1'] - activerecord: ['6.0', '6.1', '7.0', '7.1'] + activerecord: ['6.1', '7.0', '7.1'] env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.activerecord }}.gemfile steps: diff --git a/Appraisals b/Appraisals index f307c24..e15ce13 100644 --- a/Appraisals +++ b/Appraisals @@ -1,15 +1,14 @@ -appraise "rails-6.0" do - gem 'rails', '~> 6.0' -end - appraise "rails-6.1" do gem 'rails', '~> 6.1' + gem "rspec-rails", '>= 6' end appraise "rails-7.0" do gem 'rails', '~> 7.0' + gem "rspec-rails", '>= 6' end appraise "rails-7.1" do gem 'rails', '~> 7.1' + gem "rspec-rails", '>= 6' end diff --git a/activerecord-userstamp.gemspec b/activerecord-userstamp.gemspec index 3f92a33..2f53d86 100644 --- a/activerecord-userstamp.gemspec +++ b/activerecord-userstamp.gemspec @@ -26,7 +26,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'tzinfo-data' if RUBY_PLATFORM =~ /mswin|mingw/ s.add_development_dependency 'rake' s.add_development_dependency 'rdoc' - s.add_development_dependency 'rspec-rails', '>= 6' s.add_development_dependency 'simplecov' s.add_development_dependency 'coveralls' s.add_development_dependency 'codeclimate-test-reporter' diff --git a/gemfiles/rails_6.0.gemfile b/gemfiles/rails_6.0.gemfile deleted file mode 100644 index 10c6284..0000000 --- a/gemfiles/rails_6.0.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", "~> 6.0" - -gemspec path: "../" diff --git a/gemfiles/rails_6.1.gemfile b/gemfiles/rails_6.1.gemfile index c34b486..89b786e 100644 --- a/gemfiles/rails_6.1.gemfile +++ b/gemfiles/rails_6.1.gemfile @@ -3,5 +3,6 @@ source "https://rubygems.org" gem "rails", "~> 6.1" +gem "rspec-rails", ">= 6" gemspec path: "../" diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile index 9d2735b..678ebd7 100644 --- a/gemfiles/rails_7.0.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -3,5 +3,6 @@ source "https://rubygems.org" gem "rails", "~> 7.0" +gem "rspec-rails", ">= 6" gemspec path: "../" diff --git a/gemfiles/rails_7.1.gemfile b/gemfiles/rails_7.1.gemfile index 1d906c3..ccfb1c8 100644 --- a/gemfiles/rails_7.1.gemfile +++ b/gemfiles/rails_7.1.gemfile @@ -3,5 +3,6 @@ source "https://rubygems.org" gem "rails", "~> 7.1" +gem "rspec-rails", ">= 6" gemspec path: "../" diff --git a/spec/lib/migration_spec.rb b/spec/lib/migration_spec.rb index 4e02e76..fdf50f4 100644 --- a/spec/lib/migration_spec.rb +++ b/spec/lib/migration_spec.rb @@ -32,16 +32,15 @@ class self::DefaultRandom < ActiveRecord::Base end context 'when overridden attribute names are used' do - before(:all) do + before(:each) do ActiveRecord::Userstamp.configure do |config| config.creator_attribute = :created_by config.updater_attribute = :updated_by config.deleter_attribute = :deleted_by end - end - - class self::OverriddenRandom < ActiveRecord::Base - stampable + class self::OverriddenRandom < ActiveRecord::Base + stampable + end end subject { self.class::OverriddenRandom.new } @@ -50,7 +49,7 @@ class self::OverriddenRandom < ActiveRecord::Base t.userstamps end - after(:all) do + after(:each) do ActiveRecord::Userstamp.configure do |config| config.creator_attribute = :creator_id config.updater_attribute = :updater_id