diff --git a/Gemfile b/Gemfile index 59f77c9d..dd3185b6 100644 --- a/Gemfile +++ b/Gemfile @@ -53,7 +53,13 @@ group :bench do end group :test do - gem 'sqlite3', '~> 1.3.13', platform: (@windows_platforms + [:ruby]) + platforms *(@windows_platforms + [:ruby]) do + if version == 'master' || version >= '6' + gem 'sqlite3', '~> 1.4' + else + gem 'sqlite3', '~> 1.3.13' + end + end platforms :jruby do if version == 'master' || version >= '5' gem 'activerecord-jdbcsqlite3-adapter', '~> 50' diff --git a/test/support/ruby_2_6_rails_4_2_patch.rb b/test/support/ruby_2_6_rails_4_2_patch.rb new file mode 100644 index 00000000..e4de2432 --- /dev/null +++ b/test/support/ruby_2_6_rails_4_2_patch.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +if RUBY_VERSION >= '2.6.0' + if Rails::VERSION::MAJOR < 5 + class ActionController::TestResponse < ActionDispatch::TestResponse + def recycle! + # hack to avoid MonitorMixin double-initialize error: + @mon_mutex_owner_object_id = nil + @mon_mutex = nil + initialize + end + end + else + puts "Monkeypatch for ActionController::TestResponse no longer needed" + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index 80996494..e8f60cc9 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -56,6 +56,8 @@ end require 'support/rails_app' +require 'support/ruby_2_6_rails_4_2_patch' + # require "rails/test_help" require 'support/serialization_testing'