hella-redis 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hella-redis/connection_spy.rb +10 -0
- data/lib/hella-redis/version.rb +1 -1
- data/test/unit/connection_spy_tests.rb +11 -1
- metadata +10 -10
@@ -38,6 +38,16 @@ module HellaRedis
|
|
38
38
|
@calls = []
|
39
39
|
end
|
40
40
|
|
41
|
+
def pipelined
|
42
|
+
@calls << RedisCall.new(:pipelined, [])
|
43
|
+
yield self
|
44
|
+
end
|
45
|
+
|
46
|
+
def multi
|
47
|
+
@calls << RedisCall.new(:multi, [])
|
48
|
+
yield self
|
49
|
+
end
|
50
|
+
|
41
51
|
def method_missing(name, *args, &block)
|
42
52
|
if self.respond_to?(name)
|
43
53
|
@calls << RedisCall.new(name, args, block)
|
data/lib/hella-redis/version.rb
CHANGED
@@ -66,7 +66,7 @@ class HellaRedis::ConnectionSpy
|
|
66
66
|
end
|
67
67
|
subject{ @redis_spy }
|
68
68
|
|
69
|
-
should have_readers :calls
|
69
|
+
should have_readers :pipelined, :multi, :calls
|
70
70
|
|
71
71
|
should "default its calls" do
|
72
72
|
assert_equal [], subject.calls
|
@@ -88,6 +88,16 @@ class HellaRedis::ConnectionSpy
|
|
88
88
|
assert_equal [key, value], call.args
|
89
89
|
end
|
90
90
|
|
91
|
+
should "track the call and yield itself using `pipelined`" do
|
92
|
+
subject.pipelined{ |c| c.set(Factory.string, Factory.string) }
|
93
|
+
assert_equal [:pipelined, :set], subject.calls.map(&:command)
|
94
|
+
end
|
95
|
+
|
96
|
+
should "track the call and yield itself using `multi`" do
|
97
|
+
subject.multi{ |c| c.set(Factory.string, Factory.string) }
|
98
|
+
assert_equal [:multi, :set], subject.calls.map(&:command)
|
99
|
+
end
|
100
|
+
|
91
101
|
should "raise no method errors for non-redis methods" do
|
92
102
|
assert_false subject.respond_to?(:super_awesome_set)
|
93
103
|
assert_raises(NoMethodError) do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hella-redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2015-
|
19
|
+
date: 2015-05-27 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
@@ -28,9 +28,9 @@ dependencies:
|
|
28
28
|
segments:
|
29
29
|
- 0
|
30
30
|
version: "0"
|
31
|
-
version_requirements: *id001
|
32
31
|
type: :development
|
33
32
|
name: assert
|
33
|
+
version_requirements: *id001
|
34
34
|
prerelease: false
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
requirement: &id002 !ruby/object:Gem::Requirement
|
@@ -43,9 +43,9 @@ dependencies:
|
|
43
43
|
- 3
|
44
44
|
- 2
|
45
45
|
version: "3.2"
|
46
|
-
version_requirements: *id002
|
47
46
|
type: :runtime
|
48
47
|
name: redis
|
48
|
+
version_requirements: *id002
|
49
49
|
prerelease: false
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
@@ -58,9 +58,9 @@ dependencies:
|
|
58
58
|
- 1
|
59
59
|
- 5
|
60
60
|
version: "1.5"
|
61
|
-
version_requirements: *id003
|
62
61
|
type: :runtime
|
63
62
|
name: redis-namespace
|
63
|
+
version_requirements: *id003
|
64
64
|
prerelease: false
|
65
65
|
- !ruby/object:Gem::Dependency
|
66
66
|
requirement: &id004 !ruby/object:Gem::Requirement
|
@@ -74,9 +74,9 @@ dependencies:
|
|
74
74
|
- 9
|
75
75
|
- 2
|
76
76
|
version: 0.9.2
|
77
|
-
version_requirements: *id004
|
78
77
|
type: :runtime
|
79
78
|
name: connection_pool
|
79
|
+
version_requirements: *id004
|
80
80
|
prerelease: false
|
81
81
|
description: It's-a hella-redis!
|
82
82
|
email:
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
requirements: []
|
135
135
|
|
136
136
|
rubyforge_project:
|
137
|
-
rubygems_version: 1.8.
|
137
|
+
rubygems_version: 1.8.25
|
138
138
|
signing_key:
|
139
139
|
specification_version: 3
|
140
140
|
summary: It's-a hella-redis!
|