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 +4 -4
- data/lib/flapjack/data/entity.rb +1 -0
- data/lib/flapjack/version.rb +1 -1
- data/spec/lib/flapjack/data/entity_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ede6c2a1d9cef33334510db3aafc14c3adfe81e
|
4
|
+
data.tar.gz: 1e9dd581aec598085752a982f13d93a0936799de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f7d21e0b77c86255e58a11786e7a288bc0b11101f1357d764f14bf8b0c6232566293fd577f3ba8652b81311c22e973954581ddcb08a243bfdd0b7d82ebd5cc1
|
7
|
+
data.tar.gz: 1cb8e1563662182441a1067baf645b9410133e480af1ec31fb28cb6d39978273e6b046ee67bfe01164a54a7988ff1d03bbd3eda7dc3359a3ef1da4f70c43a8ae
|
data/lib/flapjack/data/entity.rb
CHANGED
@@ -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
|
data/lib/flapjack/version.rb
CHANGED
@@ -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},
|