README.md in resque_spec-0.12.6 vs README.md in resque_spec-0.12.7
- old
+ new
@@ -206,10 +206,25 @@
end
end
(And I take note of the `before` block that is calling `reset!` for every spec)
+You can explicitly specify the queue when using enqueue_at_with_queue and
+enqueue_in_with_queue:
+
+ describe "#recalculate_in_future" do
+ before do
+ ResqueSpec.reset!
+ end
+
+ it "adds person.calculate to the :future queue" do
+ person.recalculate_in_future
+
+ Person.should have_schedule_size_of(1).queue(:future)
+ end
+ end
+
And I might write this as a Cucumber step
Then /the (\w?) has (\w?) scheduled/ do |thing, method|
thing_obj = instance_variable_get("@#{thing}")
thing_obj.class.should have_scheduled(thing_obj.id, method.to_sym)
@@ -221,10 +236,14 @@
@queue = :people
def recalculate
Resque.enqueue_at(Time.now + 3600, Person, id, :calculate)
end
+
+ def recalculate_in_future
+ Resque.enqueue_at_with_queue(:future, Time.now + 3600, Person, id, :calculate)
+ end
end
Performing Jobs in Specs
========================
@@ -348,9 +367,10 @@
* @lellisga (Li Ellis Gallardo) :fix inline/disable\_ext bug
* @jeffdeville (Jeff Deville) :Resque.size
* @opinel (Frank Wambutt) :Fix DST problem in `have\_scheduled`
* @lukemelia (Luke Melia) :Add `times` chained matcher
* @heelhook (Pablo Fernandez) :Add `have_queue_size_of_at_least` and `have_schedule_size_of_at_least` matchers
+* @k1w1 :Add support for enqueue_at_with_queue/enqueue_in_with_queue
Copyright
=========
Copyright (c) 2010-2012 Les Hill. See LICENSE for details.