flapjack 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01e6182ada345384e280d5ed7a9ead80cc1c47c9
4
- data.tar.gz: 2c93d9a269af81a435b8d24f17b96c5ffd69996a
3
+ metadata.gz: 5ede6c2a1d9cef33334510db3aafc14c3adfe81e
4
+ data.tar.gz: 1e9dd581aec598085752a982f13d93a0936799de
5
5
  SHA512:
6
- metadata.gz: ae3191374c88fae709ada04de6a27cdcd7203e99fb1bde425bf76819681f8c9bad2841f02207c2e41e37cc87b7cd15ede2bb7c61d48aba7af8e6cce6f3bce2ef
7
- data.tar.gz: 43f07542553f64a3f886dc8f4dc7efb7f51dc23ddf3f4a802c7ee2fe9eedfb4ef768878655644fc5f8f4316377b21075f7e10d50b18d30f458fd5c3a8998053e
6
+ metadata.gz: 4f7d21e0b77c86255e58a11786e7a288bc0b11101f1357d764f14bf8b0c6232566293fd577f3ba8652b81311c22e973954581ddcb08a243bfdd0b7d82ebd5cc1
7
+ data.tar.gz: 1cb8e1563662182441a1067baf645b9410133e480af1ec31fb28cb6d39978273e6b046ee67bfe01164a54a7988ff1d03bbd3eda7dc3359a3ef1da4f70c43a8ae
@@ -17,6 +17,7 @@ module Flapjack
17
17
  def self.all(options = {})
18
18
  raise "Redis connection not set" unless redis = options[:redis]
19
19
  keys = redis.keys("entity_id:*")
20
+ return [] unless keys.any?
20
21
  ids = redis.mget(keys)
21
22
  keys.collect {|k|
22
23
  k =~ /^entity_id:(.+)$/; entity_name = $1
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  module Flapjack
4
- VERSION = "0.8.0"
4
+ VERSION = "0.8.1"
5
5
  end
@@ -69,6 +69,13 @@ describe Flapjack::Data::Entity, :redis => true do
69
69
  expect(entity.id).to eq('5000')
70
70
  end
71
71
 
72
+ it "returns an empty list when asked for all entities, if there are no entities" do
73
+ entities = Flapjack::Data::Entity.all(:redis => @redis)
74
+ expect(entities).not_to be_nil
75
+ expect(entities).to be_an(Array)
76
+ expect(entities.size).to eq(0)
77
+ end
78
+
72
79
  it "returns a list of all entities" do
73
80
  Flapjack::Data::Entity.add({'id' => '5000',
74
81
  'name' => name},
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flapjack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindsay Holmwood