resque_spec 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +3 -3
- data/lib/resque_spec/scheduler.rb +8 -0
- data/lib/resque_spec/version.rb +1 -1
- metadata +13 -2
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
ResqueSpec
|
2
2
|
==========
|
3
3
|
|
4
|
-
A simple RSpec and Cucumber matcher for Resque.enqueue and
|
5
|
-
(from `ResqueScheduler`), loosely based on
|
4
|
+
A simple RSpec and Cucumber matcher for Resque.enqueue and
|
5
|
+
Resque.enqueue_at/enqueue_in (from `ResqueScheduler`), loosely based on
|
6
6
|
[http://github.com/justinweiss/resque_unit](http://github.com/justinweiss/resque_unit).
|
7
7
|
|
8
8
|
ResqueSpec will also fire Resque hooks if you are using them. See below.
|
@@ -190,7 +190,7 @@ The after enqueue hook is always called when you use `Resque#enqueue`.
|
|
190
190
|
The `perform` hooks: before, around, after, and on failure are fired by
|
191
191
|
ResqueSpec if you are using the `with_resque` helper or set `ResqueSpec.inline = true`.
|
192
192
|
|
193
|
-
Important! `Resque#enqueue_at` does not fire the after enqueue hook (the job has not been queued yet!), but will fire the `perform` hooks if you are using `inline` mode.
|
193
|
+
Important! `Resque#enqueue_at/enqueue_in` does not fire the after enqueue hook (the job has not been queued yet!), but will fire the `perform` hooks if you are using `inline` mode.
|
194
194
|
|
195
195
|
Note on Patches/Pull Requests
|
196
196
|
=============================
|
@@ -5,12 +5,20 @@ module ResqueSpec
|
|
5
5
|
def enqueue_at(time, klass, *args)
|
6
6
|
ResqueSpec.enqueue_at(time, klass, *args)
|
7
7
|
end
|
8
|
+
|
9
|
+
def enqueue_in(time, klass, *args)
|
10
|
+
ResqueSpec.enqueue_in(time, klass, *args)
|
11
|
+
end
|
8
12
|
end
|
9
13
|
|
10
14
|
def enqueue_at(time, klass, *args)
|
11
15
|
store(schedule_queue_name(klass), klass, { :class => klass.to_s, :time => time, :args => args })
|
12
16
|
end
|
13
17
|
|
18
|
+
def enqueue_in(time, klass, *args)
|
19
|
+
enqueue_at(Time.now + time, klass, *args)
|
20
|
+
end
|
21
|
+
|
14
22
|
def schedule_for(klass)
|
15
23
|
queues[schedule_queue_name(klass)]
|
16
24
|
end
|
data/lib/resque_spec/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: resque_spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.6.
|
5
|
+
version: 0.6.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Les Hill
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-06-08 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -46,6 +46,17 @@ dependencies:
|
|
46
46
|
version: "0"
|
47
47
|
type: :development
|
48
48
|
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: timecop
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
type: :development
|
59
|
+
version_requirements: *id004
|
49
60
|
description: RSpec matchers for Resque
|
50
61
|
email: leshill@gmail.com
|
51
62
|
executables: []
|