redis-namespace 0.9.0 → 0.10.0
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.
Potentially problematic release.
This version of redis-namespace might be problematic. Click here for more details.
- data/lib/redis/namespace.rb +2 -0
- data/spec/redis_spec.rb +9 -4
- metadata +3 -3
data/lib/redis/namespace.rb
CHANGED
data/spec/redis_spec.rb
CHANGED
@@ -50,19 +50,19 @@ describe "redis" do
|
|
50
50
|
@namespaced['foo'] = 1000
|
51
51
|
@namespaced['bar'] = 2000
|
52
52
|
@namespaced.mapped_mget('foo', 'bar').should == { 'foo' => '1000', 'bar' => '2000' }
|
53
|
-
@namespaced.mapped_mget('foo', 'baz', 'bar').should == {'foo'=>'1000', 'bar'=>'2000'}
|
53
|
+
@namespaced.mapped_mget('foo', 'baz', 'bar').should == {'foo'=>'1000', 'bar'=>'2000', 'baz' => nil}
|
54
54
|
end
|
55
55
|
|
56
56
|
it "should be able to use a namespace with mset" do
|
57
57
|
@namespaced.mset('foo', '1000', 'bar', '2000')
|
58
58
|
@namespaced.mapped_mget('foo', 'bar').should == { 'foo' => '1000', 'bar' => '2000' }
|
59
|
-
@namespaced.mapped_mget('foo', 'baz', 'bar').should == { 'foo' => '1000', 'bar' => '2000'}
|
59
|
+
@namespaced.mapped_mget('foo', 'baz', 'bar').should == { 'foo' => '1000', 'bar' => '2000', 'baz' => nil}
|
60
60
|
end
|
61
61
|
|
62
62
|
it "should be able to use a namespace with msetnx" do
|
63
63
|
@namespaced.msetnx('foo', '1000', 'bar', '2000')
|
64
64
|
@namespaced.mapped_mget('foo', 'bar').should == { 'foo' => '1000', 'bar' => '2000' }
|
65
|
-
@namespaced.mapped_mget('foo', 'baz', 'bar').should == { 'foo' => '1000', 'bar' => '2000'}
|
65
|
+
@namespaced.mapped_mget('foo', 'baz', 'bar').should == { 'foo' => '1000', 'bar' => '2000', 'baz' => nil}
|
66
66
|
end
|
67
67
|
|
68
68
|
it "should be able to use a namespace with hashes" do
|
@@ -73,7 +73,12 @@ describe "redis" do
|
|
73
73
|
@namespaced.hlen('foo').should == 2
|
74
74
|
@namespaced.hkeys('foo').should == ['key', 'key1']
|
75
75
|
@namespaced.hmset('bar', 'key', 'value', 'key1', 'value1')
|
76
|
-
@namespaced.
|
76
|
+
@namespaced.hmget('bar', 'key', 'key1')
|
77
|
+
@namespaced.hmset('bar', 'a_number', 1)
|
78
|
+
@namespaced.hmget('bar', 'a_number').should == ['1']
|
79
|
+
@namespaced.hincrby('bar', 'a_number', 3)
|
80
|
+
@namespaced.hmget('bar', 'a_number').should == ['4']
|
81
|
+
@namespaced.hgetall('bar').should == {'key' => 'value', 'key1' => 'value1', 'a_number' => '4'}
|
77
82
|
end
|
78
83
|
|
79
84
|
it "should properly intersect three sets" do
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 10
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.10.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Chris Wanstrath
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-23 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|