redis_support 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -65,3 +65,7 @@ attempts to run it at the same time:
65
65
  end
66
66
  end
67
67
 
68
+ Issues
69
+ ------
70
+
71
+ * When RedisSupport.redis is called but not yet set, there is a stack-level too deep error though it should just return nil.
@@ -11,7 +11,11 @@ module RedisSupport
11
11
  end
12
12
 
13
13
  def redis
14
- @redis || RedisSupport.redis
14
+ if(self == RedisSupport)
15
+ @redis
16
+ else
17
+ @redis || RedisSupport.redis
18
+ end
15
19
  end
16
20
 
17
21
  # Goal is to allow a class to declare a redis key/property
@@ -19,6 +19,20 @@ context "Redis Support Setup" do
19
19
  end
20
20
  end
21
21
 
22
+ context "Redis Support No Setup" do
23
+ setup do
24
+ RedisSupport.redis=nil
25
+ end
26
+
27
+ test "redis returns nil when nil" do
28
+ assert_equal RedisSupport.redis, nil
29
+ assert_equal TestClass.redis, nil
30
+ assert_equal SecondTest.redis, nil
31
+
32
+ assert_equal TestClass.new.redis, nil
33
+ end
34
+ end
35
+
22
36
  context "Redis Support" do
23
37
  setup do
24
38
  RedisSupport.redis = "localhost:9736"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_support
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 11
10
- version: 0.0.11
9
+ - 12
10
+ version: 0.0.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian P O'Rourke
@@ -16,11 +16,13 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-07-08 00:00:00 -07:00
19
+ date: 2010-07-14 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
- requirement: &id001 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ name: redis
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
26
  none: false
25
27
  requirements:
26
28
  - - ">="
@@ -31,10 +33,8 @@ dependencies:
31
33
  - 0
32
34
  - 4
33
35
  version: 1.0.4
36
+ requirement: *id001
34
37
  type: :runtime
35
- name: redis
36
- prerelease: false
37
- version_requirements: *id001
38
38
  description: "Module for adding redis functionality to classes: simple key namespacing and locking and connections"
39
39
  email: dolores@doloreslabs.com
40
40
  executables: []
@@ -48,8 +48,8 @@ files:
48
48
  - lib/redis_support/class_extensions.rb
49
49
  - lib/redis_support/locks.rb
50
50
  - README.md
51
- - test/helper.rb
52
51
  - test/test_redis_support.rb
52
+ - test/helper.rb
53
53
  has_rdoc: true
54
54
  homepage: http://github.com/dolores/redis_support
55
55
  licenses: []
@@ -85,5 +85,5 @@ signing_key:
85
85
  specification_version: 3
86
86
  summary: A Redis Support module
87
87
  test_files:
88
- - test/helper.rb
89
88
  - test/test_redis_support.rb
89
+ - test/helper.rb