Skip to content

Commit

Permalink
Handle ruby 3.4 message expectation
Browse files Browse the repository at this point in the history
  • Loading branch information
albus522 committed Aug 13, 2024
1 parent e815df8 commit b27cdc9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/delayed/backend/shared_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,12 @@ def create_job(opts = {})
worker.work_off
@job.reload
expect(@job.last_error).to match(/did not work/)
expect(@job.last_error).to match(/sample_jobs.rb:\d+:in `perform'/)
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
# Ruby 3.4 produces a more verbose message
expect(@job.last_error).to match(/sample_jobs.rb:\d+:in 'ErrorJob#perform'/)
else
expect(@job.last_error).to match(/sample_jobs.rb:\d+:in `perform'/)
end
expect(@job.attempts).to eq(1)
expect(@job.run_at).to be > Delayed::Job.db_time_now - 10.minutes
expect(@job.run_at).to be < Delayed::Job.db_time_now + 10.minutes
Expand Down

0 comments on commit b27cdc9

Please sign in to comment.