From aa0a510eac26773b069667215f895824a69e0d8f Mon Sep 17 00:00:00 2001 From: Stefan Kaes Date: Sun, 17 Nov 2024 18:46:03 +0100 Subject: [PATCH] fix AR tests for Rails 8.0.0 --- Appraisals | 1 + test/unit/database_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Appraisals b/Appraisals index 96dd50c..6eb7f18 100644 --- a/Appraisals +++ b/Appraisals @@ -6,6 +6,7 @@ appraisals = [ if RUBY_VERSION >= "3.1" appraisals << "7.2.2" + appraisals << "8.0.0" end appraisals.each do |rails_version| diff --git a/test/unit/database_test.rb b/test/unit/database_test.rb index 25b20f1..902036f 100644 --- a/test/unit/database_test.rb +++ b/test/unit/database_test.rb @@ -68,7 +68,7 @@ def teardown ActiveRecord::Base.connection.execute "SELECT 1" bandit.consumed assert(bandit.current_runtime > 0) - if ActiveRecord::VERSION::STRING =~ /\A7.2\..*\Z/ + if ActiveRecord::VERSION::STRING >= Gem::Version.new("7.2.0") # registry ingores schema calls now assert_equal 1, bandit.calls else @@ -86,7 +86,7 @@ def teardown ActiveRecord::Base.connection.execute "SELECT 1" bandit.consumed assert(bandit.current_runtime > 0) - if ActiveRecord::VERSION::STRING =~ /\A7.2\..*\Z/ + if ActiveRecord::VERSION::STRING >= Gem::Version.new("7.2.0") # registry ingores schema calls now assert_equal 1, bandit.calls else