From 64127efa41d1950b551c68c67d68f9ccd9702457 Mon Sep 17 00:00:00 2001 From: tbotaq Date: Sun, 7 Feb 2021 02:26:29 +0900 Subject: [PATCH 1/4] Add 3.0.0 to the list --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e37db300..68638730 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ rvm: - "2.5.7" - "2.6.5" - "2.7.0" + - "3.0.0" gemfile: - gemfiles/rails_5.0.gemfile - gemfiles/rails_5.1.gemfile From 249c2551ce21949bfc50b840f4217d24ea6d9291 Mon Sep 17 00:00:00 2001 From: tbotaq Date: Sun, 7 Feb 2021 02:30:21 +0900 Subject: [PATCH 2/4] Remove :rbx specification from .gemfile * which prevents the CI builds with Ruby 3 from succeeding * and is no longer listed in the build list of our CI --- gemfiles/rails_5.0.gemfile | 6 ------ gemfiles/rails_5.1.gemfile | 6 ------ gemfiles/rails_5.2.gemfile | 6 ------ gemfiles/rails_6.0.gemfile | 6 ------ 4 files changed, 24 deletions(-) diff --git a/gemfiles/rails_5.0.gemfile b/gemfiles/rails_5.0.gemfile index 7528170e..9d9e4d01 100644 --- a/gemfiles/rails_5.0.gemfile +++ b/gemfiles/rails_5.0.gemfile @@ -15,10 +15,4 @@ platform :ruby do gem 'sqlite3', '~> 1.3.0' end -platforms :rbx do - gem 'racc' - gem 'rubysl', '~> 2.0' - gem 'psych' -end - gemspec :path => '../' diff --git a/gemfiles/rails_5.1.gemfile b/gemfiles/rails_5.1.gemfile index e5e0b9f2..47976f74 100644 --- a/gemfiles/rails_5.1.gemfile +++ b/gemfiles/rails_5.1.gemfile @@ -15,10 +15,4 @@ platform :ruby do gem 'sqlite3', '~> 1.3.0' end -platforms :rbx do - gem 'racc' - gem 'rubysl', '~> 2.0' - gem 'psych' -end - gemspec :path => '../' diff --git a/gemfiles/rails_5.2.gemfile b/gemfiles/rails_5.2.gemfile index 53362f8e..1bedd86e 100644 --- a/gemfiles/rails_5.2.gemfile +++ b/gemfiles/rails_5.2.gemfile @@ -15,10 +15,4 @@ platform :ruby do gem 'sqlite3', '~> 1.3.0' end -platforms :rbx do - gem 'racc' - gem 'rubysl', '~> 2.0' - gem 'psych' -end - gemspec :path => '../' diff --git a/gemfiles/rails_6.0.gemfile b/gemfiles/rails_6.0.gemfile index 89fd37d6..e4453669 100644 --- a/gemfiles/rails_6.0.gemfile +++ b/gemfiles/rails_6.0.gemfile @@ -15,10 +15,4 @@ platform :ruby do gem 'sqlite3' end -platforms :rbx do - gem 'racc' - gem 'rubysl', '~> 2.0' - gem 'psych' -end - gemspec :path => '../' From 61a6baa9755b6397768b6abfed3dc0146f812033 Mon Sep 17 00:00:00 2001 From: tbotaq Date: Sun, 7 Feb 2021 03:26:41 +0900 Subject: [PATCH 3/4] Exclude Ruby 3 x Rails 5.x combinations from the matrix Rails 5 doesn't work with Ruby 3 See: https://github.com/rails/rails/issues/40938 --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 68638730..0061b657 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,5 +20,11 @@ matrix: exclude: - rvm: 2.4.9 gemfile: gemfiles/rails_6.0.gemfile + - rvm: 3.0.0 + gemfile: gemfiles/rails_5.0.gemfile + - rvm: 3.0.0 + gemfile: gemfiles/rails_5.1.gemfile + - rvm: 3.0.0 + gemfile: gemfiles/rails_5.2.gemfile script: "bundle exec rake spec" From f0b1a9feaf8a0a29c921c47e9fb7beb8d6dea41b Mon Sep 17 00:00:00 2001 From: tbotaq Date: Sun, 7 Feb 2021 02:37:31 +0900 Subject: [PATCH 4/4] Fix(test): Pass the option as a keyword argument to go with Ruby 3. --- spec/associations/active_record_extensions_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/associations/active_record_extensions_spec.rb b/spec/associations/active_record_extensions_spec.rb index 400d9a06..a1a11982 100644 --- a/spec/associations/active_record_extensions_spec.rb +++ b/spec/associations/active_record_extensions_spec.rb @@ -180,7 +180,7 @@ class Book < ActiveRecord::Base it "doesn't raise any exception when the belongs_to association class can't be autoloaded" do # Simulate autoloader allow_any_instance_of(String).to receive(:constantize).and_raise(LoadError, "Unable to autoload constant NonExistent") - expect { School.belongs_to :city, {class_name: 'NonExistent'} }.not_to raise_error + expect { School.belongs_to :city, class_name: 'NonExistent' }.not_to raise_error end end