Skip to content

Commit

Permalink
Add minimal support for Rails 6
Browse files Browse the repository at this point in the history
* Add Rails 6 appraisal to start testing against it.
* Fix usage of Module#parent as this is deprecated in Rails 6 in favor
  of Module#module_parent.
* Ensure that we're using the correct version of `sqlite3` and `pg` at
  all times
* When creating classes within tests, ensure that they are removed
  correctly
* Fix detection of has_secure_password in models: Check that
  InstanceMethodsOnActivation is specifically defined, as Rails 6 no
  longer has such a module.

Co-authored-by: Lee Machin <me@mrl.ee>
  • Loading branch information
mcmire and Lee Machin committed Apr 22, 2019
1 parent 9a47fa3 commit ae9bf4a
Show file tree
Hide file tree
Showing 21 changed files with 553 additions and 77 deletions.
18 changes: 16 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
language: ruby
sudo: false
addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10
env:
- DATABASE_ADAPTER=sqlite3
- DATABASE_ADAPTER=postgresql
global:
- PGPORT=5433
matrix:
- DATABASE_ADAPTER=sqlite3
- DATABASE_ADAPTER=postgresql
rvm:
- 2.4.4
- 2.5.4
Expand All @@ -12,8 +21,13 @@ gemfile:
- gemfiles/rails_5_0.gemfile
- gemfiles/rails_5_1.gemfile
- gemfiles/rails_5_2.gemfile
- gemfiles/rails_6_0.gemfile
matrix:
exclude:
- rvm: 2.3.7
gemfile: gemfiles/rails_6_0.gemfile
- rvm: 2.4.4
gemfile: gemfiles/rails_6_0.gemfile
- rvm: 2.6.2
gemfile: gemfiles/rails_4_2.gemfile
cache: bundler
Expand Down
38 changes: 34 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ shared_jruby_dependencies = proc do
end

shared_rails_dependencies = proc do
gem 'sqlite3', platform: :ruby
gem 'pg', platform: :ruby
gem 'sqlite3', '~> 1.3.6', platform: :ruby
end

shared_spring_dependencies = proc do
Expand All @@ -23,7 +22,6 @@ end

shared_test_dependencies = proc do
gem 'minitest-reporters'
# gem 'nokogiri', '~> 1.8'
gem 'rspec-rails', '~> 3.6'
gem 'shoulda-context', '~> 1.2.0'
end
Expand All @@ -48,10 +46,11 @@ appraise 'rails_4_2' do
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bcrypt', '~> 3.1.7'

# Other dependencies we use
# Other dependencies
gem 'activeresource', '4.0.0'
gem 'json', '~> 1.4'
gem 'protected_attributes', '~> 1.0.6'
gem 'pg', '~> 0.15', platform: :ruby
end

appraise 'rails_5_0' do
Expand All @@ -67,6 +66,9 @@ appraise 'rails_5_0' do
gem 'bcrypt', '~> 3.1.7'
gem 'listen', '~> 3.0.5'
gem 'spring-watcher-listen', '~> 2.0.0'

# Other dependencies
gem 'pg', '~> 1.1', platform: :ruby
end

appraise 'rails_5_1' do
Expand All @@ -83,6 +85,9 @@ appraise 'rails_5_1' do
gem 'selenium-webdriver'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring-watcher-listen', '~> 2.0.0'

# Other dependencies
gem 'pg', '~> 1.1', platform: :ruby
end

appraise 'rails_5_2' do
Expand All @@ -101,4 +106,29 @@ appraise 'rails_5_2' do
gem 'chromedriver-helper'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring-watcher-listen', '~> 2.0.0'

# Other dependencies
gem 'pg', '~> 1.1', platform: :ruby
end

appraise 'rails_6_0' do
instance_eval(&shared_dependencies)

gem 'rails', '~> 6.0.0.beta3'
gem 'puma', '~> 3.11'
gem 'bootsnap', '>= 1.4.1', require: false
gem 'sass-rails', '~> 5.0'
gem 'webpacker', '>= 4.0.0.rc3'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bcrypt', '~> 3.1.7'
gem 'capybara', '>= 2.15'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'selenium-webdriver'
gem 'chromedriver-helper'

# Other dependencies
gem 'rails-controller-testing', '>= 1.0.1'
gem 'pg', '~> 1.1', platform: :ruby
end
4 changes: 2 additions & 2 deletions gemfiles/rails_4_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "jruby-openssl", platform: :jruby
gem "therubyrhino", platform: :jruby
gem "sqlite3", platform: :ruby
gem "pg", platform: :ruby
gem "sqlite3", "~> 1.3.6", platform: :ruby
gem "spring"
gem "spring-commands-rspec"
gem "minitest-reporters"
Expand All @@ -38,3 +37,4 @@ gem "bcrypt", "~> 3.1.7"
gem "activeresource", "4.0.0"
gem "json", "~> 1.4"
gem "protected_attributes", "~> 1.0.6"
gem "pg", "~> 0.15", platform: :ruby
4 changes: 2 additions & 2 deletions gemfiles/rails_4_2.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ DEPENDENCIES
jruby-openssl
json (~> 1.4)
minitest-reporters
pg
pg (~> 0.15)
protected_attributes (~> 1.0.6)
pry
pry-byebug
Expand All @@ -251,7 +251,7 @@ DEPENDENCIES
shoulda-context (~> 1.2.0)
spring
spring-commands-rspec
sqlite3
sqlite3 (~> 1.3.6)
therubyrhino
turbolinks
uglifier (>= 1.3.0)
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/rails_5_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "jruby-openssl", platform: :jruby
gem "therubyrhino", platform: :jruby
gem "sqlite3", platform: :ruby
gem "pg", platform: :ruby
gem "sqlite3", "~> 1.3.6", platform: :ruby
gem "spring"
gem "spring-commands-rspec"
gem "minitest-reporters"
Expand All @@ -36,3 +35,4 @@ gem "jbuilder", "~> 2.5"
gem "bcrypt", "~> 3.1.7"
gem "listen", "~> 3.0.5"
gem "spring-watcher-listen", "~> 2.0.0"
gem "pg", "~> 1.1", platform: :ruby
6 changes: 3 additions & 3 deletions gemfiles/rails_5_0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ GEM
parallel (1.12.1)
parser (2.5.1.2)
ast (~> 2.4.0)
pg (0.21.0)
pg (1.1.4)
powerpack (0.1.2)
pry (0.11.3)
coderay (~> 1.1.0)
Expand Down Expand Up @@ -227,7 +227,7 @@ DEPENDENCIES
jruby-openssl
listen (~> 3.0.5)
minitest-reporters
pg
pg (~> 1.1)
pry
pry-byebug
puma (~> 3.0)
Expand All @@ -244,7 +244,7 @@ DEPENDENCIES
spring
spring-commands-rspec
spring-watcher-listen (~> 2.0.0)
sqlite3
sqlite3 (~> 1.3.6)
therubyrhino
turbolinks (~> 5)
yard
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/rails_5_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "jruby-openssl", platform: :jruby
gem "therubyrhino", platform: :jruby
gem "sqlite3", platform: :ruby
gem "pg", platform: :ruby
gem "sqlite3", "~> 1.3.6", platform: :ruby
gem "spring"
gem "spring-commands-rspec"
gem "minitest-reporters"
Expand All @@ -37,3 +36,4 @@ gem "capybara", "~> 2.13"
gem "selenium-webdriver"
gem "listen", ">= 3.0.5", "< 3.2"
gem "spring-watcher-listen", "~> 2.0.0"
gem "pg", "~> 1.1", platform: :ruby
4 changes: 2 additions & 2 deletions gemfiles/rails_5_1.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ DEPENDENCIES
jruby-openssl
listen (>= 3.0.5, < 3.2)
minitest-reporters
pg
pg (~> 1.1)
pry
pry-byebug
puma (~> 3.7)
Expand All @@ -261,7 +261,7 @@ DEPENDENCIES
spring
spring-commands-rspec
spring-watcher-listen (~> 2.0.0)
sqlite3
sqlite3 (~> 1.3.6)
therubyrhino
turbolinks (~> 5)
yard
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/rails_5_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "jruby-openssl", platform: :jruby
gem "therubyrhino", platform: :jruby
gem "sqlite3", platform: :ruby
gem "pg", platform: :ruby
gem "sqlite3", "~> 1.3.6", platform: :ruby
gem "spring"
gem "spring-commands-rspec"
gem "minitest-reporters"
Expand All @@ -39,3 +38,4 @@ gem "selenium-webdriver"
gem "chromedriver-helper"
gem "listen", ">= 3.0.5", "< 3.2"
gem "spring-watcher-listen", "~> 2.0.0"
gem "pg", "~> 1.1", platform: :ruby
4 changes: 2 additions & 2 deletions gemfiles/rails_5_2.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ DEPENDENCIES
jruby-openssl
listen (>= 3.0.5, < 3.2)
minitest-reporters
pg
pg (~> 1.1)
pry
pry-byebug
puma (~> 3.11)
Expand All @@ -280,7 +280,7 @@ DEPENDENCIES
spring
spring-commands-rspec
spring-watcher-listen (~> 2.0.0)
sqlite3
sqlite3 (~> 1.3.6)
therubyrhino
turbolinks (~> 5)
yard
Expand Down
42 changes: 42 additions & 0 deletions gemfiles/rails_6_0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal", "2.2.0"
gem "bundler", "~> 1.1"
gem "pry"
gem "pry-byebug"
gem "rake", "12.3.2"
gem "rspec", "~> 3.6"
gem "rubocop", require: false
gem "zeus", require: false
gem "fssm"
gem "pygments.rb"
gem "redcarpet"
gem "yard"
gem "activerecord-jdbc-adapter", platform: :jruby
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "jruby-openssl", platform: :jruby
gem "therubyrhino", platform: :jruby
gem "sqlite3", "~> 1.3.6", platform: :ruby
gem "spring"
gem "spring-commands-rspec"
gem "minitest-reporters"
gem "rspec-rails", "~> 3.6"
gem "shoulda-context", "~> 1.2.0"
gem "rails", "~> 6.0.0.beta3"
gem "puma", "~> 3.11"
gem "bootsnap", ">= 1.4.1", require: false
gem "sass-rails", "~> 5.0"
gem "webpacker", ">= 4.0.0.rc3"
gem "turbolinks", "~> 5"
gem "jbuilder", "~> 2.5"
gem "bcrypt", "~> 3.1.7"
gem "capybara", ">= 2.15"
gem "listen", ">= 3.0.5", "< 3.2"
gem "spring-watcher-listen", "~> 2.0.0"
gem "selenium-webdriver"
gem "chromedriver-helper"
gem "rails-controller-testing", ">= 1.0.1"
gem "pg", "~> 1.1", platform: :ruby
Loading

0 comments on commit ae9bf4a

Please sign in to comment.