resque_spec 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -12,9 +12,10 @@ The current version works with `Resque v1.19.0` and up and `RSpec v2.5.0` and up
12
12
  Install
13
13
  -------
14
14
 
15
- Update your Gemfile to include `resque_spec` only in the *test* group (Not using
16
- `bundler`? Do the necessary thing for your app's gem management and use
17
- `bundler`. `resque_spec` is a mock API, it should only be used with your tests!)
15
+ Update your Gemfile to include `resque_spec` only in the *test* group (Not
16
+ using `bundler`? Do the necessary thing for your app's gem management and use
17
+ `bundler`. `resque_spec` monkey patches `resque` it should only be used with
18
+ your tests!)
18
19
 
19
20
  group :test do
20
21
  gem 'resque_spec'
@@ -23,10 +24,10 @@ Update your Gemfile to include `resque_spec` only in the *test* group (Not using
23
24
  What is ResqueSpec?
24
25
  ===================
25
26
 
26
- ResqueSpec is a fake of the *stable API* for Resque 1.19.x (which is `enqueue`,
27
- `enqueue_to`, `dequeue`, `reserve`, and the Resque hooks). It does not have a
28
- test double for Redis, so this may lead to some interesting and puzzling
29
- behaviour if you use some of the popular Resque plugins (such as
27
+ ResqueSpec implements the *stable API* for Resque 1.19.x (which is `enqueue`,
28
+ `enqueue_to` (*unreleased*), `dequeue`, `reserve`, and the Resque hooks). It
29
+ does not have a test double for Redis, so this may lead to some interesting and
30
+ puzzling behaviour if you use some of the popular Resque plugins (such as
30
31
  `resque_lock`).
31
32
 
32
33
  Resque with Specs
@@ -258,6 +259,7 @@ Contributors
258
259
  * (@RipTheJacker) : remove_delayed support
259
260
  * Kurt Werle (@kwerle) : explicit require spec for v020
260
261
  * (@dwilkie) : initial before_enqueue support
262
+ * Marcin Balinski (@marcinb) : have_schedule_size_of matcher
261
263
 
262
264
  Copyright
263
265
  =========
@@ -100,3 +100,21 @@ RSpec::Matchers.define :have_scheduled_at do |*expected_args|
100
100
  "have scheduled at the given time the arguments"
101
101
  end
102
102
  end
103
+
104
+ RSpec::Matchers.define :have_schedule_size_of do |size|
105
+ match do |actual|
106
+ ResqueSpec.schedule_for(actual).size == size
107
+ end
108
+
109
+ failure_message_for_should do |actual|
110
+ "expected that #{actual} would have #{size} scheduled entries, but got #{ResqueSpec.schedule_for(actual).size} instead"
111
+ end
112
+
113
+ failure_message_for_should_not do |actual|
114
+ "expected that #{actual} would have #{size} scheduled entries."
115
+ end
116
+
117
+ description do
118
+ "have schedule size of #{size}"
119
+ end
120
+ end
@@ -1,3 +1,3 @@
1
1
  module ResqueSpec
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
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.8.0
4
+ version: 0.8.1
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: 2011-11-20 00:00:00.000000000Z
12
+ date: 2012-01-08 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: resque
16
- requirement: &70321864755860 !ruby/object:Gem::Requirement
16
+ requirement: &70309046836280 !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: *70321864755860
24
+ version_requirements: *70309046836280
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70321864754320 !ruby/object:Gem::Requirement
27
+ requirement: &70309046834900 !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: *70321864754320
35
+ version_requirements: *70309046834900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ruby-debug19
38
- requirement: &70321864753860 !ruby/object:Gem::Requirement
38
+ requirement: &70309046834260 !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: *70321864753860
46
+ version_requirements: *70309046834260
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: timecop
49
- requirement: &70321864753220 !ruby/object:Gem::Requirement
49
+ requirement: &70309046826600 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70321864753220
57
+ version_requirements: *70309046826600
58
58
  description: RSpec matchers for Resque
59
59
  email: leshill@gmail.com
60
60
  executables: []
@@ -95,3 +95,4 @@ signing_key:
95
95
  specification_version: 3
96
96
  summary: RSpec matchers for Resque
97
97
  test_files: []
98
+ has_rdoc: