beanstalk_farmer 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -73,7 +73,7 @@ module BeanstalkFarmer
73
73
  end
74
74
 
75
75
  def handle_job_response
76
- if response.is_a?(Array)
76
+ if response.is_a?(Array) && !response.empty?
77
77
  logger.info "JOB (#{name}) done. Response: #{response.inspect}"
78
78
  job.public_send(*response)
79
79
  else
@@ -1,3 +1,3 @@
1
1
  module BeanstalkFarmer
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
@@ -141,5 +141,24 @@ describe BeanstalkFarmer::Job do
141
141
  subject.work
142
142
  end
143
143
  end
144
+
145
+ context 'response handling with empty arguments' do
146
+ let(:handler) { lambda { |args| Array.new } }
147
+
148
+ let(:job_id) { 1 }
149
+
150
+ let(:job) { Beanstalk::Job.new(connection, job_id, body) }
151
+
152
+ subject { described_class.new(job) }
153
+
154
+ before do
155
+ described_class.handler_pool[name] = handler
156
+ end
157
+
158
+ it 'deletes the job when there are empty arguments' do
159
+ connection.should_receive(:delete).with(job_id)
160
+ subject.work
161
+ end
162
+ end
144
163
  end
145
164
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beanstalk_farmer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.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: 2011-10-18 00:00:00.000000000Z
12
+ date: 2011-10-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beanstalk-client
16
- requirement: &70206434388180 !ruby/object:Gem::Requirement
16
+ requirement: &70177161928380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.1.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70206434388180
24
+ version_requirements: *70177161928380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: multi_json
27
- requirement: &70206434387400 !ruby/object:Gem::Requirement
27
+ requirement: &70177161927620 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70206434387400
35
+ version_requirements: *70177161927620
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70206434386660 !ruby/object:Gem::Requirement
38
+ requirement: &70177161926920 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.6'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70206434386660
46
+ version_requirements: *70177161926920
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &70206434385600 !ruby/object:Gem::Requirement
49
+ requirement: &70177161926080 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.9.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70206434385600
57
+ version_requirements: *70177161926080
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: simplecov
60
- requirement: &70206434384420 !ruby/object:Gem::Requirement
60
+ requirement: &70177161924720 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 0.4.2
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70206434384420
68
+ version_requirements: *70177161924720
69
69
  description: Farmer is a nice little kit to manage a Beanstalk job queue
70
70
  email:
71
71
  - james.herdman@me.com
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  segments:
111
111
  - 0
112
- hash: -2124436020781360391
112
+ hash: -2175380131280394491
113
113
  required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  none: false
115
115
  requirements:
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  segments:
120
120
  - 0
121
- hash: -2124436020781360391
121
+ hash: -2175380131280394491
122
122
  requirements: []
123
123
  rubyforge_project:
124
124
  rubygems_version: 1.8.6