bumbleworks 0.0.14 → 0.0.15

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.
@@ -79,6 +79,12 @@ module Bumbleworks
79
79
  entity
80
80
  end
81
81
 
82
+ def has_entity?
83
+ !entity.nil?
84
+ rescue EntityNotFound
85
+ false
86
+ end
87
+
82
88
  def has_entity_fields?
83
89
  fields['entity_id'] && fields['entity_type']
84
90
  end
@@ -1,3 +1,3 @@
1
1
  module Bumbleworks
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -412,6 +412,20 @@ describe Bumbleworks::Task do
412
412
  end
413
413
  end
414
414
 
415
+ describe '#has_entity?' do
416
+ it 'returns true if entity is not nil' do
417
+ task = described_class.new(workflow_item)
418
+ task.stub(:entity).and_return(:a_real_boy_not_a_puppet)
419
+ task.has_entity?.should be_true
420
+ end
421
+
422
+ it 'returns false if EntityNotFound' do
423
+ task = described_class.new(workflow_item)
424
+ task.stub(:entity).and_raise(Bumbleworks::Task::EntityNotFound)
425
+ task.has_entity?.should be_false
426
+ end
427
+ end
428
+
415
429
  describe '#entity' do
416
430
  class LovelyEntity
417
431
  def self.first_by_identifier(identifier)
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.14
4
+ version: 0.0.15
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-01 00:00:00.000000000 Z
15
+ date: 2013-07-03 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: ruote
@@ -222,12 +222,18 @@ 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
225
228
  required_rubygems_version: !ruby/object:Gem::Requirement
226
229
  none: false
227
230
  requirements:
228
231
  - - ! '>='
229
232
  - !ruby/object:Gem::Version
230
233
  version: '0'
234
+ segments:
235
+ - 0
236
+ hash: -2176906903713510636
231
237
  requirements: []
232
238
  rubyforge_project:
233
239
  rubygems_version: 1.8.23
@@ -264,4 +270,3 @@ test_files:
264
270
  - spec/lib/bumbleworks_spec.rb
265
271
  - spec/spec_helper.rb
266
272
  - spec/support/path_helpers.rb
267
- has_rdoc: