fairway 0.1.1 → 0.1.2

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fairway (0.1.0)
4
+ fairway (0.1.1)
5
5
  activesupport
6
6
  hiredis
7
7
  redis
@@ -1,3 +1,3 @@
1
1
  module Fairway
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -50,7 +50,7 @@ for i, queue in ipairs(ARGV) do
50
50
  -- current facet's priority if needed.
51
51
  else
52
52
  local priority = tonumber(redis.call('hget', priorities, facet)) or 1
53
- local current = tonumber(redis.call('hget', facet_pool, facet))
53
+ local current = tonumber(redis.call('hget', facet_pool, facet)) or 1
54
54
 
55
55
  -- If the current priority is less than the
56
56
  -- desired priority, let's increase the priority
@@ -285,6 +285,25 @@ module Fairway
285
285
  queue.pull.should == ["myqueue", message2.to_json]
286
286
  queue.pull.should == ["myqueue", message1.to_json]
287
287
  end
288
+
289
+ it "defaults current priority to 1 if currently nil (migration from 0.0.x to 0.1.x scenario)" do
290
+ connection.deliver(message1)
291
+ connection.deliver(message1)
292
+ connection.deliver(message2)
293
+ connection.deliver(message2)
294
+ connection.deliver(message2)
295
+ connection.deliver(message1)
296
+
297
+ connection.redis.del("myqueue:facet_pool")
298
+
299
+ queue.pull.should == ["myqueue", message1.to_json]
300
+ queue.pull.should == ["myqueue", message2.to_json]
301
+ queue.pull.should == ["myqueue", message1.to_json]
302
+ queue.pull.should == ["myqueue", message2.to_json]
303
+ queue.pull.should == ["myqueue", message1.to_json]
304
+ queue.pull.should == ["myqueue", message2.to_json]
305
+ queue.pull.should be_nil
306
+ end
288
307
  end
289
308
 
290
309
  describe "equality" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fairway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-08 00:00:00.000000000 Z
12
+ date: 2013-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport