Simple Rspec matcher for Resque that is inspired by resque_spec (https://github.com/leshill/resque_spec). The difference is that this matcher uses Redis and does not simulate Resque.
To check if job is enqueued with specific arguments, you can use the
To check the size of the queue of a job, you can use the
Running a Worker in Specs
To run a worker in a spec, you can call
run_resque with the queue you want to be worked on.
describe "#calculate" do before do RspecResque.reset! end it "should calculate" do stats.calculate run_resque(:stats) stats.value == 100 end end
Clearing Resque Related Keys in Redis
To clear resque related keys in Redis that were created during the test, you can call