Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
use Appraisal for testing multiple versions of Rails
Browse files Browse the repository at this point in the history
  • Loading branch information
westonganger committed Dec 28, 2018
1 parent bf7a82a commit ec0bd16
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 63 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ language: ruby
sudo: false
cache: bundler
rvm:
- 2.2.6
- 2.3.3
- 2.4.0
- 2.3
- 2.4
- 2.5
- ruby-head

gemfile:
- gemfiles/Gemfile-rails-5.0-stable
- gemfiles/Gemfile-rails-5.1-stable
- gemfiles/Gemfile-rails-5.0
- gemfiles/Gemfile-rails-5.1
- gemfiles/Rails_5.0.x
- gemfiles/Rails_5.1.x
- gemfiles/Rails_5.2.x

matrix:
allow_failures:
- rvm: ruby-head
- gemfile: gemfiles/Rails_master

notifications:
email: false
11 changes: 11 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
appraise "Rails 5.2.x" do
gem "rails", "~> 5.2.0"
end

appraise "Rails 5.1.x" do
gem "rails", "~> 5.1.0"
end

appraise "Rails 5.0.x" do
gem "rails", "~> 5.0.0"
end
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Fix bug related to incorrect usage of options on the AR#new method
* Use scope_for_create instead of create_scope in Rails 5.2+
* Fix bug related to protection of `inheritance_column` attribute
* Use Appraisal for testing against multple Rails versions

## 1.3.0

Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source 'https://rubygems.org'

gem 'rails', '~>5.0'
### By default test against Rails v5.2.x, will be overridden by anything in Appraisal file
gem 'rails', '~>5.2.0'

gemspec
15 changes: 0 additions & 15 deletions gemfiles/Gemfile-rails-4.2

This file was deleted.

15 changes: 0 additions & 15 deletions gemfiles/Gemfile-rails-4.2-stable

This file was deleted.

5 changes: 0 additions & 5 deletions gemfiles/Gemfile-rails-5.0

This file was deleted.

5 changes: 0 additions & 5 deletions gemfiles/Gemfile-rails-5.0-stable

This file was deleted.

5 changes: 0 additions & 5 deletions gemfiles/Gemfile-rails-5.1

This file was deleted.

5 changes: 0 additions & 5 deletions gemfiles/Gemfile-rails-5.1-stable

This file was deleted.

7 changes: 7 additions & 0 deletions gemfiles/Rails_5.0.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 5.0.0"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/Rails_5.1.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 5.1.0"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/Rails_5.2.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 5.2.0"

gemspec path: "../"
11 changes: 6 additions & 5 deletions protected_attributes_continued.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ Gem::Specification.new do |gem|
gem.files = Dir["LICENSE.txt", "README.md", "lib/**/*"]
gem.require_paths = ["lib"]

gem.add_dependency "activemodel", "~>5.0"
gem.add_dependency "activemodel", ">= 5.0"

gem.add_development_dependency "activerecord", "~>5.0"
gem.add_development_dependency "actionpack", "~>5.0"
gem.add_development_dependency "railties", "~>5.0"
gem.add_development_dependency "activerecord", ">= 5.0"
gem.add_development_dependency "actionpack", ">= 5.0"
gem.add_development_dependency "railties", ">= 5.0"
gem.add_development_dependency "sqlite3"
gem.add_development_dependency "mocha"
gem.add_development_dependency "mocha", "~> 1.4.0"
gem.add_development_dependency 'appraisal'
end
2 changes: 2 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
require 'mocha/api'
require 'rails'

Rails.backtrace_cleaner.remove_silencers!

ActiveSupport.test_order = :random if ActiveSupport.respond_to?(:test_order)

0 comments on commit ec0bd16

Please sign in to comment.