worker_roulette 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module WorkerRoulette
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -50,11 +50,11 @@ module WorkerRoulette
50
50
  end
51
51
 
52
52
  def self.pool_size
53
- @pool_config[:size]
53
+ (@pool_config ||= {})[:size]
54
54
  end
55
55
 
56
56
  def self.redis_config
57
- @redis_config.dup
57
+ (@redis_config ||= {}).dup
58
58
  end
59
59
 
60
60
  def self.dump(obj)
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+ module WorkerRoulette
3
+ describe WorkerRoulette do
4
+ it "should not explode if redis_config is called before start" do
5
+ WorkerRoulette.instance_variable_set("@redis_config", nil)
6
+ expect {WorkerRoulette.redis_config}.not_to raise_error
7
+ end
8
+
9
+ it "should not explode if pool_size is called before start" do
10
+ WorkerRoulette.instance_variable_set("@pool_config", nil)
11
+ expect {WorkerRoulette.pool_size}.not_to raise_error
12
+ end
13
+ end
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worker_roulette
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
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: 2014-02-21 00:00:00.000000000 Z
12
+ date: 2014-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oj
@@ -295,6 +295,7 @@ files:
295
295
  - spec/unit/evented_readlock_spec.rb
296
296
  - spec/unit/lua_spec.rb
297
297
  - spec/unit/readlock_spec.rb
298
+ - spec/unit/worker_roulette_spec.rb
298
299
  - worker_roulette.gemspec
299
300
  homepage: https://github.com/nexiahome/worker_roulette
300
301
  licenses: []
@@ -329,4 +330,5 @@ test_files:
329
330
  - spec/unit/evented_readlock_spec.rb
330
331
  - spec/unit/lua_spec.rb
331
332
  - spec/unit/readlock_spec.rb
333
+ - spec/unit/worker_roulette_spec.rb
332
334
  has_rdoc: