resque_spec 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +22 -17
- data/lib/resque_spec/matchers.rb +3 -3
- data/lib/resque_spec/version.rb +1 -1
- metadata +12 -12
data/README.md
CHANGED
@@ -109,10 +109,14 @@ environment. Your initializer will probably end up looking like:
|
|
109
109
|
# config/initializers/resque_mailer.rb
|
110
110
|
Resque::Mailer.excluded_environments = []
|
111
111
|
|
112
|
-
|
112
|
+
resque-scheduler with Specs
|
113
113
|
==========================
|
114
114
|
|
115
|
-
To use with
|
115
|
+
To use with resque-scheduler, add this require `require 'resque_spec/scheduler'`
|
116
|
+
|
117
|
+
*n.b.* Yes, you also need to require resque-scheduler, this works (check the docs for other ways):
|
118
|
+
|
119
|
+
gem "resque-scheduler", :require => "resque_scheduler"
|
116
120
|
|
117
121
|
Given this scenario
|
118
122
|
|
@@ -273,7 +277,7 @@ not be queued and `after_enqueue` will not be called.
|
|
273
277
|
The `perform` hooks: before, around, after, and on failure are fired by
|
274
278
|
ResqueSpec if you are using the `with_resque` helper or set `ResqueSpec.inline = true`.
|
275
279
|
|
276
|
-
Important! If you are using
|
280
|
+
Important! If you are using resque-scheduler, `Resque#enqueue_at/enqueue_in`
|
277
281
|
does not fire the after enqueue hook (the job has not been queued yet!), but
|
278
282
|
will fire the `perform` hooks if you are using `inline` mode.
|
279
283
|
|
@@ -298,20 +302,21 @@ Follow me on [Github](https://github.com/leshill) and
|
|
298
302
|
Contributors
|
299
303
|
============
|
300
304
|
|
301
|
-
* Kenneth Kalmer
|
302
|
-
* Brian Cardarella
|
303
|
-
* Joshua Davey
|
304
|
-
* Lar Van Der Jagt
|
305
|
-
* Evan Sagge
|
306
|
-
* Jon Larkowski
|
307
|
-
* James Conroy-Finn(@jcf) : spec fix
|
308
|
-
* Dennis Walters
|
309
|
-
*
|
310
|
-
* Kurt Werle
|
311
|
-
*
|
312
|
-
* Marcin Balinski
|
313
|
-
*
|
314
|
-
*
|
305
|
+
* Kenneth Kalmer (@kennethkalmer) : rspec dependency fix
|
306
|
+
* Brian Cardarella (@bcardarella) : fix mutation bug
|
307
|
+
* Joshua Davey (@joshdavey) : with_resque helper
|
308
|
+
* Lar Van Der Jagt (@supaspoida) : with_resque helper
|
309
|
+
* Evan Sagge (@evansagge) : Hook in via Job.create, have_queued.in
|
310
|
+
* Jon Larkowski (@l4rk) : inline perform
|
311
|
+
* James Conroy-Finn (@jcf) : spec fix
|
312
|
+
* Dennis Walters (@ess) : enqueue_in support
|
313
|
+
* (@RipTheJacker) : remove_delayed support
|
314
|
+
* Kurt Werle (@kwerle) : explicit require spec for v020
|
315
|
+
* (@dwilkie) : initial before_enqueue support
|
316
|
+
* Marcin Balinski (@marcinb) : have_schedule_size_of matcher, schedule matcher at, in
|
317
|
+
* (@alexeits) : fix matcher in bug with RSpec 2.8.0
|
318
|
+
* (@ToadJamb) : encode/decode of Resque job arguments
|
319
|
+
* Mateusz Konikowski (@mkonikowski) : support for anything matcher
|
315
320
|
|
316
321
|
Copyright
|
317
322
|
=========
|
data/lib/resque_spec/matchers.rb
CHANGED
@@ -28,7 +28,7 @@ RSpec::Matchers.define :have_queued do |*expected_args|
|
|
28
28
|
extend InQueueHelper
|
29
29
|
|
30
30
|
match do |actual|
|
31
|
-
queue(actual).any? { |entry| entry[:class].to_s == actual.to_s && entry[:args]
|
31
|
+
queue(actual).any? { |entry| entry[:class].to_s == actual.to_s && expected_args == entry[:args] }
|
32
32
|
end
|
33
33
|
|
34
34
|
failure_message_for_should do |actual|
|
@@ -80,7 +80,7 @@ RSpec::Matchers.define :have_scheduled do |*expected_args|
|
|
80
80
|
match do |actual|
|
81
81
|
ResqueSpec.schedule_for(actual).any? do |entry|
|
82
82
|
class_matches = entry[:class].to_s == actual.to_s
|
83
|
-
args_match = entry[:args]
|
83
|
+
args_match = expected_args == entry[:args]
|
84
84
|
|
85
85
|
time_matches = if @time
|
86
86
|
entry[:time] == @time
|
@@ -113,7 +113,7 @@ RSpec::Matchers.define :have_scheduled_at do |*expected_args|
|
|
113
113
|
match do |actual|
|
114
114
|
time = expected_args.first
|
115
115
|
other_args = expected_args[1..-1]
|
116
|
-
ResqueSpec.schedule_for(actual).any? { |entry| entry[:class].to_s == actual.to_s && entry[:time] == time && entry[:args]
|
116
|
+
ResqueSpec.schedule_for(actual).any? { |entry| entry[:class].to_s == actual.to_s && entry[:time] == time && other_args == entry[:args] }
|
117
117
|
end
|
118
118
|
|
119
119
|
failure_message_for_should do |actual|
|
data/lib/resque_spec/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque_spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03
|
12
|
+
date: 2012-04-03 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: resque
|
16
|
-
requirement: &
|
16
|
+
requirement: &70150271545920 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.19.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70150271545920
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70150271544920 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.5.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70150271544920
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: ruby-debug19
|
38
|
-
requirement: &
|
38
|
+
requirement: &70150271544240 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70150271544240
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: timecop
|
49
|
-
requirement: &
|
49
|
+
requirement: &70150271542700 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70150271542700
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &70150271541580 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70150271541580
|
69
69
|
description: RSpec matchers for Resque
|
70
70
|
email: leshill@gmail.com
|
71
71
|
executables: []
|