README.md in resque_spec-0.6.7 vs README.md in resque_spec-0.6.8
- old
+ new
@@ -25,11 +25,11 @@
group :test do
gem 'resque_spec'
end
Resque with Specs
------------------
+=================
Given this scenario
Given a person
When I recalculate
@@ -79,11 +79,11 @@
Resque.enqueue(Person, id, :calculate)
end
end
ResqueScheduler with Specs
---------------------------
+==========================
To use with ResqueScheduler, add this require `require 'resque_spec/scheduler'`
Given this scenario
@@ -124,11 +124,11 @@
Resque.enqueue_at(Time.now + 3600, Person, id, :calculate)
end
end
Queue Size Specs
-----------------
+================
You can check the size of the queue in your specs too.
describe "#recalculate" do
before do
@@ -140,18 +140,18 @@
Person.should have_queue_size_of(1)
end
end
Performing Jobs in Specs
-------------------------
+========================
Normally, Resque does not perform queued jobs within tests. You may want to
make assertions based on the result of your jobs. ResqueSpec can process jobs
immediately as they are queued or under your control.
Performing jobs immediately
-===========================
+---------------------------
To perform jobs immediately, you can pass a block to the `with_resque` helper:
Given this scenario
@@ -184,11 +184,11 @@
end
You can turn this behavior on by setting `ResqueSpec.inline = true`.
Performing jobs at your discretion
-===================================
+----------------------------------
You can perform the first job on a queue at a time, or perform all the jobs on
a queue. Use `ResqueSpec#perform_next(queue_name)` or
`ResqueSpec#perform_all(queue_name)`
@@ -204,10 +204,10 @@
When /the (\w+) queue runs/ do |queue_name|
ResqueSpec.perform_all(queue_name)
end
Hooks
------
+=====
Resque provides hooks at different points of the queueing lifecylce. ResqueSpec fires these hooks when appropriate.
The after enqueue hook is always called when you use `Resque#enqueue`.