bumbleworks 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,6 +38,10 @@ module Bumbleworks
38
38
  from_workitems(workitems)
39
39
  end
40
40
 
41
+ def for_claimant(token)
42
+ all.select { |t| t.claimant == token }
43
+ end
44
+
41
45
  def all
42
46
  from_workitems(storage_participant.all)
43
47
  end
@@ -1,3 +1,3 @@
1
1
  module Bumbleworks
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
@@ -239,6 +239,30 @@ describe Bumbleworks::Task do
239
239
  end
240
240
  end
241
241
 
242
+ context '.for_claimant' do
243
+ it 'returns all tasks claimed by given claimant' do
244
+ Bumbleworks.define_process 'dog-lifecycle' do
245
+ concurrence do
246
+ dog :task => 'eat'
247
+ dog :task => 'bark'
248
+ dog :task => 'pet_dog'
249
+ the_universe_is_wonderful
250
+ cat :task => 'skip_and_jump'
251
+ end
252
+ dog :task => 'nap'
253
+ end
254
+ Bumbleworks.launch!('dog-lifecycle')
255
+ Bumbleworks.dashboard.wait_for(:dog)
256
+ described_class.for_claimant('radish').should be_empty
257
+ described_class.all.each do |t|
258
+ t.claim('radish') unless t.nickname == 'pet_dog'
259
+ end
260
+ @tasks = described_class.for_claimant('radish')
261
+ @tasks.should have(3).items
262
+ @tasks.map(&:nickname).should =~ ['eat', 'bark', 'skip_and_jump']
263
+ end
264
+ end
265
+
242
266
  context 'claiming things' do
243
267
  before :each do
244
268
  Bumbleworks.define_process 'planting_a_noodle' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bumbleworks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-07-03 00:00:00.000000000 Z
15
+ date: 2013-07-08 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: ruote
@@ -222,18 +222,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
222
222
  - - ! '>='
223
223
  - !ruby/object:Gem::Version
224
224
  version: '0'
225
- segments:
226
- - 0
227
- hash: -2176906903713510636
228
225
  required_rubygems_version: !ruby/object:Gem::Requirement
229
226
  none: false
230
227
  requirements:
231
228
  - - ! '>='
232
229
  - !ruby/object:Gem::Version
233
230
  version: '0'
234
- segments:
235
- - 0
236
- hash: -2176906903713510636
237
231
  requirements: []
238
232
  rubyforge_project:
239
233
  rubygems_version: 1.8.23
@@ -270,3 +264,4 @@ test_files:
270
264
  - spec/lib/bumbleworks_spec.rb
271
265
  - spec/spec_helper.rb
272
266
  - spec/support/path_helpers.rb
267
+ has_rdoc: