Skip to content

Commit

Permalink
Use simple testing via ENV variable matrix
Browse files Browse the repository at this point in the history
Appraisal is nice but it can be simplified.
Additionally, it doesn't currently support the bundler plugin api so
override_gem, plugin, etc., won't work.  We do this in some repositories
so unless there's a reason to stick with appraisal, it's safer
to use a solution that's simpler and more future-proof.

See: `https://github.com/thoughtbot/appraisal/issues/178`
  • Loading branch information
jrafanie committed Feb 1, 2022
1 parent 78823df commit 07a826e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 30 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/.bundle/
/.yardoc
/Gemfile.lock
/gemfiles/*gemfile.lock
/_yardoc/
/coverage/
/doc/
Expand Down
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ rvm:
- 2.7.5
- 3.0.3
cache: bundler
gemfile:
- gemfiles/rails_6.0.gemfile
- gemfiles/rails_6.1.gemfile
env:
matrix:
- TEST_RAILS_VERSION=6.1
- TEST_RAILS_VERSION=6.0
addons:
postgresql: '10'
before_script:
Expand Down
9 changes: 0 additions & 9 deletions Appraisals

This file was deleted.

9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in activerecord-id_regions.gemspec
gemspec

case ENV['TEST_RAILS_VERSION']
when "6.0"
gem "activerecord", "~>6.0.4"
gem "activesupport", "~>6.0.4"
when "6.1"
gem "activerecord", "~>6.1.4"
gem "activesupport", "~>6.1.4"
end
1 change: 0 additions & 1 deletion activerecord-id_regions.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Gem::Specification.new do |spec|
spec.add_dependency "activesupport", ">= 5.0", "< 7.0"
spec.add_dependency "pg"

spec.add_development_dependency "appraisal"
spec.add_development_dependency "bundler"
spec.add_development_dependency "manageiq-style"
spec.add_development_dependency "rake"
Expand Down
8 changes: 0 additions & 8 deletions gemfiles/rails_6.0.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_6.1.gemfile

This file was deleted.

6 changes: 6 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@ def change
create_table :test_records, :id => :bigserial
end
end

require "active_record"
require "active_support"
puts
puts "\e[93mUsing ActiveRecord #{ActiveRecord.version}\e[0m"
puts "\e[93mUsing ActiveSupport #{ActiveSupport.version}\e[0m"

0 comments on commit 07a826e

Please sign in to comment.