You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/spec/support/sidekiq_matchers.rb

18 lines
460 B
Ruby

RSpec::Matchers.define :have_queued_job do |*expected|
match do |actual|
actual.jobs.any? { |job| Array(expected) == job["args"] }
end
failure_message_for_should do |actual|
"expected that #{actual} would have a job queued with #{expected}"
end
failure_message_for_should_not do |actual|
"expected that #{actual} would not a have a job queued with #{expected}"
end
description do
"have a job queued with #{expected}"
end
end