Skip to content

Commit

Permalink
Test against all supported versions of Rails
Browse files Browse the repository at this point in the history
Add Appraisal and require usage of it from now on when running tests.
  • Loading branch information
mcmire committed Sep 19, 2019
1 parent 40e2948 commit 6397394
Show file tree
Hide file tree
Showing 15 changed files with 684 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ cache:
env:
# Source: https://github.com/rspec/rspec-rails/pull/2148
- JAVA_OPTS="--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=java.base/java.io=org.jruby.dist"
gemfile:
- gemfiles/rails_5_0.gemfile
- gemfiles/rails_5_1.gemfile
- gemfiles/rails_5_2.gemfile
- gemfiles/rails_6_0.gemfile
matrix:
exclude:
- rvm: ruby-2.4.6
gemfile: gemfiles/rails_6_0.gemfile
rvm:
- ruby-2.6.3
- ruby-2.5.5
Expand Down
34 changes: 34 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
common_dependencies = proc do
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
end

appraise "rails_5_0" do
instance_eval(&common_dependencies)

gem "activerecord", "~> 5.0.0"
gem "sqlite3", "~> 1.3.6", platform: [:ruby, :mswin, :mingw]
end

appraise "rails_5_1" do
instance_eval(&common_dependencies)

gem "activerecord", "~> 5.1.0"
gem "sqlite3", "~> 1.3.6", platform: [:ruby, :mswin, :mingw]
end

appraise "rails_5_2" do
instance_eval(&common_dependencies)

gem "activerecord", "~> 5.2.0"
gem "sqlite3", "~> 1.3.6", platform: [:ruby, :mswin, :mingw]
end

if Gem::Requirement.new(">= 2.5.0").satisfied_by?(Gem::Version.new(RUBY_VERSION))
appraise "rails_6_0" do
instance_eval(&common_dependencies)

gem "activerecord", "~> 6.0"
gem "sqlite3", "~> 1.4.0", platform: [:ruby, :mswin, :mingw]
end
end
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ source "https://rubygems.org"

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "appraisal"
gem "childprocess"
gem "jdbc-sqlite3", platform: :jruby
gem "pry-byebug", platform: :mri
gem "pry-nav", platform: :jruby
gem "rake"
Expand All @@ -15,6 +14,5 @@ gem "rspec-expectations", github: "rspec/rspec-expectations"
gem "rspec-mocks", github: "rspec/rspec-mocks"
gem "rspec-support", github: "rspec/rspec-support"
gem "rubocop"
gem "sqlite3", platform: [:ruby, :mswin, :mingw]

gemspec
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ Finally, submit your PR and I'll take a look at it when I get a chance.

## Compatibility

`super_diff` is [tested][travis] to work with Ruby >= 2.4.x and RSpec 3.x.
`super_diff` is [tested][travis] to work with Ruby >= 2.4.x, RSpec 3.x, and
Rails >= 5.x.

[travis]: http://travis-ci.org/mcmire/super_diff

Expand Down
2 changes: 2 additions & 0 deletions gemfiles/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_RETRY: "1"
20 changes: 20 additions & 0 deletions gemfiles/rails_5_0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal"
gem "childprocess"
gem "pry-byebug", platform: :mri
gem "pry-nav", platform: :jruby
gem "rake"
gem "rspec-core", git: "https://github.com/rspec/rspec-core"
gem "rspec-expectations", git: "https://github.com/rspec/rspec-expectations"
gem "rspec-mocks", git: "https://github.com/rspec/rspec-mocks"
gem "rspec-support", git: "https://github.com/rspec/rspec-support"
gem "rubocop"
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "activerecord", "~> 5.0.0"
gem "sqlite3", "~> 1.3.6", platform: [:ruby, :mswin, :mingw]

gemspec path: "../"
121 changes: 121 additions & 0 deletions gemfiles/rails_5_0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
GIT
remote: https://github.com/rspec/rspec-core
revision: 8a287bd893889dba60e7bfce530727e7b009651e
specs:
rspec-core (3.9.0.pre)
rspec-support (= 3.9.0.pre)

GIT
remote: https://github.com/rspec/rspec-expectations
revision: 4310cb957c922334791cade79f688c8143c74916
specs:
rspec-expectations (3.9.0.pre)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (= 3.9.0.pre)

GIT
remote: https://github.com/rspec/rspec-mocks
revision: a62ec6fc309680a21ad3a88409500181381b13f8
specs:
rspec-mocks (3.9.0.pre)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (= 3.9.0.pre)

GIT
remote: https://github.com/rspec/rspec-support
revision: c69a231d7369dd165ad7ce4742e1a2e21e3462b5
specs:
rspec-support (3.9.0.pre)

PATH
remote: ..
specs:
super_diff (0.1.0)
activerecord (> 4.2, < 7.0)
attr_extras
diff-lcs
patience_diff

GEM
remote: https://rubygems.org/
specs:
activemodel (5.0.7.2)
activesupport (= 5.0.7.2)
activerecord (5.0.7.2)
activemodel (= 5.0.7.2)
activesupport (= 5.0.7.2)
arel (~> 7.0)
activesupport (5.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
appraisal (2.2.0)
bundler
rake
thor (>= 0.14.0)
arel (7.1.4)
ast (2.4.0)
attr_extras (6.2.1)
byebug (11.0.1)
childprocess (2.0.0)
rake (< 13.0)
coderay (1.1.2)
concurrent-ruby (1.1.5)
diff-lcs (1.3)
i18n (1.6.0)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.3)
method_source (0.9.2)
minitest (5.11.3)
parallel (1.17.0)
parser (2.6.4.1)
ast (~> 2.4.0)
patience_diff (1.1.0)
trollop (~> 1.16)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.7.0)
byebug (~> 11.0)
pry (~> 0.10)
rainbow (3.0.0)
rake (12.3.3)
rubocop (0.74.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
sqlite3 (1.3.13)
thor (0.20.3)
thread_safe (0.3.6)
trollop (1.16.2)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.6.0)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 5.0.0)
activerecord-jdbcsqlite3-adapter
appraisal
childprocess
jdbc-sqlite3
pry-byebug
pry-nav
rake
rspec-core!
rspec-expectations!
rspec-mocks!
rspec-support!
rubocop
sqlite3 (~> 1.3.6)
super_diff!

BUNDLED WITH
2.0.2
20 changes: 20 additions & 0 deletions gemfiles/rails_5_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal"
gem "childprocess"
gem "pry-byebug", platform: :mri
gem "pry-nav", platform: :jruby
gem "rake"
gem "rspec-core", git: "https://github.com/rspec/rspec-core"
gem "rspec-expectations", git: "https://github.com/rspec/rspec-expectations"
gem "rspec-mocks", git: "https://github.com/rspec/rspec-mocks"
gem "rspec-support", git: "https://github.com/rspec/rspec-support"
gem "rubocop"
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "activerecord", "~> 5.1.0"
gem "sqlite3", "~> 1.3.6", platform: [:ruby, :mswin, :mingw]

gemspec path: "../"
121 changes: 121 additions & 0 deletions gemfiles/rails_5_1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
GIT
remote: https://github.com/rspec/rspec-core
revision: 8a287bd893889dba60e7bfce530727e7b009651e
specs:
rspec-core (3.9.0.pre)
rspec-support (= 3.9.0.pre)

GIT
remote: https://github.com/rspec/rspec-expectations
revision: 4310cb957c922334791cade79f688c8143c74916
specs:
rspec-expectations (3.9.0.pre)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (= 3.9.0.pre)

GIT
remote: https://github.com/rspec/rspec-mocks
revision: a62ec6fc309680a21ad3a88409500181381b13f8
specs:
rspec-mocks (3.9.0.pre)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (= 3.9.0.pre)

GIT
remote: https://github.com/rspec/rspec-support
revision: c69a231d7369dd165ad7ce4742e1a2e21e3462b5
specs:
rspec-support (3.9.0.pre)

PATH
remote: ..
specs:
super_diff (0.1.0)
activerecord (> 4.2, < 7.0)
attr_extras
diff-lcs
patience_diff

GEM
remote: https://rubygems.org/
specs:
activemodel (5.1.7)
activesupport (= 5.1.7)
activerecord (5.1.7)
activemodel (= 5.1.7)
activesupport (= 5.1.7)
arel (~> 8.0)
activesupport (5.1.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
appraisal (2.2.0)
bundler
rake
thor (>= 0.14.0)
arel (8.0.0)
ast (2.4.0)
attr_extras (6.2.1)
byebug (11.0.1)
childprocess (2.0.0)
rake (< 13.0)
coderay (1.1.2)
concurrent-ruby (1.1.5)
diff-lcs (1.3)
i18n (1.6.0)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.3)
method_source (0.9.2)
minitest (5.11.3)
parallel (1.17.0)
parser (2.6.4.1)
ast (~> 2.4.0)
patience_diff (1.1.0)
trollop (~> 1.16)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.7.0)
byebug (~> 11.0)
pry (~> 0.10)
rainbow (3.0.0)
rake (12.3.3)
rubocop (0.74.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
sqlite3 (1.3.13)
thor (0.20.3)
thread_safe (0.3.6)
trollop (1.16.2)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.6.0)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 5.1.0)
activerecord-jdbcsqlite3-adapter
appraisal
childprocess
jdbc-sqlite3
pry-byebug
pry-nav
rake
rspec-core!
rspec-expectations!
rspec-mocks!
rspec-support!
rubocop
sqlite3 (~> 1.3.6)
super_diff!

BUNDLED WITH
2.0.2
20 changes: 20 additions & 0 deletions gemfiles/rails_5_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal"
gem "childprocess"
gem "pry-byebug", platform: :mri
gem "pry-nav", platform: :jruby
gem "rake"
gem "rspec-core", git: "https://github.com/rspec/rspec-core"
gem "rspec-expectations", git: "https://github.com/rspec/rspec-expectations"
gem "rspec-mocks", git: "https://github.com/rspec/rspec-mocks"
gem "rspec-support", git: "https://github.com/rspec/rspec-support"
gem "rubocop"
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "activerecord", "~> 5.2.0"
gem "sqlite3", "~> 1.3.6", platform: [:ruby, :mswin, :mingw]

gemspec path: "../"
Loading

0 comments on commit 6397394

Please sign in to comment.