diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1842dce3..b0f474ac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,6 +18,8 @@ jobs: - { ruby_version: '3.2', rails_gemfile: '7.2', postgres_version: '12' } - { ruby_version: '3.2', rails_gemfile: '7.2', postgres_version: '13' } - { ruby_version: '3.2', rails_gemfile: '7.2', postgres_version: '14' } + - { ruby_version: '3.3', rails_gemfile: '7.2', postgres_version: '14' } + - { ruby_version: '3.4', rails_gemfile: '7.2', postgres_version: '14' } exclude: # Rails 7.2 is not compatible with Ruby < 3.1 - ruby_version: '2.7' rails_gemfile: '7.2' diff --git a/Gemfile b/Gemfile index eeec1ae1..401e8274 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ group :development, :test do end group :test do - gem 'minitest', '~> 5.10.1' + gem 'minitest', '~> 5.25.0' gem 'minitest-profile', '0.0.2' gem 'minitest-hooks', '1.4.0' gem 'minitest-fail-fast', '0.1.0' diff --git a/spec/gemfiles/Gemfile-rails-6.0 b/spec/gemfiles/Gemfile-rails-6.0 index 9bcb0dbb..9aa92fac 100644 --- a/spec/gemfiles/Gemfile-rails-6.0 +++ b/spec/gemfiles/Gemfile-rails-6.0 @@ -15,7 +15,7 @@ group :development, :test do end group :test do - gem 'minitest', '~> 5.10.1' + gem 'minitest', '~> 5.25.0' gem 'minitest-profile', '0.0.2' gem 'minitest-hooks', '1.4.0' gem 'pry' diff --git a/spec/gemfiles/Gemfile-rails-6.1 b/spec/gemfiles/Gemfile-rails-6.1 index 7a3d2828..13908e56 100644 --- a/spec/gemfiles/Gemfile-rails-6.1 +++ b/spec/gemfiles/Gemfile-rails-6.1 @@ -15,7 +15,7 @@ group :development, :test do end group :test do - gem 'minitest', '~> 5.10.1' + gem 'minitest', '~> 5.25.0' gem 'minitest-profile', '0.0.2' gem 'minitest-hooks', '1.4.0' gem 'pry' diff --git a/spec/gemfiles/Gemfile-rails-7.0 b/spec/gemfiles/Gemfile-rails-7.0 index b40936de..c8aedb5f 100644 --- a/spec/gemfiles/Gemfile-rails-7.0 +++ b/spec/gemfiles/Gemfile-rails-7.0 @@ -15,7 +15,7 @@ group :development, :test do end group :test do - gem 'minitest', '~> 5.10.1' + gem 'minitest', '~> 5.25.0' gem 'minitest-profile', '0.0.2' gem 'minitest-hooks', '1.4.0' gem 'pry' diff --git a/spec/gemfiles/Gemfile-rails-7.1 b/spec/gemfiles/Gemfile-rails-7.1 index 2da7475c..d3999640 100644 --- a/spec/gemfiles/Gemfile-rails-7.1 +++ b/spec/gemfiles/Gemfile-rails-7.1 @@ -15,7 +15,7 @@ group :development, :test do end group :test do - gem 'minitest', '~> 5.10.1' + gem 'minitest', '~> 5.25.0' gem 'minitest-profile', '0.0.2' gem 'minitest-hooks', '1.4.0' gem 'pry' diff --git a/spec/gemfiles/Gemfile-rails-7.2 b/spec/gemfiles/Gemfile-rails-7.2 index 1caa4180..3550e0aa 100644 --- a/spec/gemfiles/Gemfile-rails-7.2 +++ b/spec/gemfiles/Gemfile-rails-7.2 @@ -15,7 +15,7 @@ group :development, :test do end group :test do - gem 'minitest', '~> 5.10.1' + gem 'minitest', '~> 5.25.0' gem 'minitest-profile', '0.0.2' gem 'minitest-hooks', '1.4.0' gem 'pry' diff --git a/spec/que/command_line_interface_spec.rb b/spec/que/command_line_interface_spec.rb index 7ee69c31..7e1350ed 100644 --- a/spec/que/command_line_interface_spec.rb +++ b/spec/que/command_line_interface_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -require 'digest/md5' +require 'securerandom' require 'que/command_line_interface' describe Que::CommandLineInterface do @@ -93,7 +93,13 @@ def write_file # same files will result in spec failures. So instead just generate a new # file name for each spec to write/delete. - name = "spec/temp/file_#{Digest::MD5.hexdigest(rand.to_s)}" + # This can't use Kernel#rand, because minitest 5.16 and up call + # `srand Minitest.seed` before shuffling each suite's methods, so the + # global PRNG replays the same sequence once per describe block. Two specs + # in different blocks would then be given the same file name, and the + # second `require` of it does nothing - the path is already in + # $LOADED_FEATURES - leaving LOADED_FILES without an entry for it. + name = "spec/temp/file_#{SecureRandom.hex(16)}" written_files << name File.open("#{name}.rb", 'w') { |f| f.puts %(LOADED_FILES["#{name}"] = true) } name diff --git a/spec/que/listener_spec.rb b/spec/que/listener_spec.rb index ddfe37b0..4adad4e3 100644 --- a/spec/que/listener_spec.rb +++ b/spec/que/listener_spec.rb @@ -273,10 +273,13 @@ def assert_message_ignored assert_instance_of Que::Error, error + # Inspected rather than written out, so that the expectation holds on + # Rubies that inspect hashes differently - 3.4 prints {priority: 90} + # where earlier versions print {:priority=>90}. expected_message = [ "Message of type 'job_available' doesn't match format!", - "Message: {:priority=>90, :queue=>\"queue_name\", :run_at=>\"2017-06-30T18:33:35.425307Z\"}", - "Format: {:id=>Integer, :priority=>Integer, :queue=>String, :run_at=>/\\A\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{6}Z\\z/}", + "Message: #{{priority: 90, queue: "queue_name", run_at: "2017-06-30T18:33:35.425307Z"}.inspect}", + "Format: #{{id: Integer, priority: Integer, queue: String, run_at: /\A\d{4}\-\d{2}\-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z\z/}.inspect}", ].join("\n") assert_equal expected_message, error.message