mock_redis 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/lib/mock_redis.rb +1 -0
- data/lib/mock_redis/version.rb +1 -1
- data/spec/commands/zrangebyscore_spec.rb +1 -1
- data/spec/commands/zrevrangebyscore_spec.rb +1 -1
- data/spec/mock_redis_spec.rb +19 -24
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/lib/mock_redis.rb
CHANGED
data/lib/mock_redis/version.rb
CHANGED
@@ -35,7 +35,7 @@ describe "#zrangebyscore(key, start, stop [:with_scores => true] [:limit => [off
|
|
35
35
|
|
36
36
|
lambda do
|
37
37
|
@redises.zrangebyscore(@key, -100, 100, :limit => "1, 2")
|
38
|
-
end.should raise_error
|
38
|
+
end.should raise_error
|
39
39
|
end
|
40
40
|
|
41
41
|
it "treats scores like floats, not strings" do
|
@@ -40,7 +40,7 @@ describe "#zrevrangebyscore(key, start, stop [:with_scores => true] [:limit => [
|
|
40
40
|
|
41
41
|
lambda do
|
42
42
|
@redises.zrevrangebyscore(@key, 100, -100, :limit => "1, 2")
|
43
|
-
end.should raise_error
|
43
|
+
end.should raise_error
|
44
44
|
end
|
45
45
|
|
46
46
|
it_should_behave_like "a zset-only command"
|
data/spec/mock_redis_spec.rb
CHANGED
@@ -1,37 +1,32 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe MockRedis do
|
4
|
+
let(:url) { 'redis://127.0.0.1:6379/1' }
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
@mock = MockRedis.new(:url => "redis://127.0.0.1:6379/1")
|
8
|
-
end
|
6
|
+
describe '.new' do
|
7
|
+
subject { MockRedis.new(:url => url) }
|
9
8
|
|
10
|
-
it
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
it 'correctly parses options' do
|
10
|
+
subject.host.should == '127.0.0.1'
|
11
|
+
subject.port.should == 6379
|
12
|
+
subject.db.should == 1
|
14
13
|
end
|
15
14
|
|
16
|
-
|
17
|
-
@mock.id.should == "redis://127.0.0.1:6379/1"
|
18
|
-
end
|
15
|
+
its(:id) { should == url }
|
19
16
|
|
20
|
-
|
21
|
-
|
22
|
-
@mock = MockRedis.connect(:url => "redis://127.0.0.1:6379/0")
|
23
|
-
end
|
17
|
+
its(:location) { should == url }
|
18
|
+
end
|
24
19
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
@mock.db.should == 0
|
29
|
-
end
|
20
|
+
describe '.connect' do
|
21
|
+
let(:url) { 'redis://127.0.0.1:6379/0' }
|
22
|
+
subject { MockRedis.connect(:url => url) }
|
30
23
|
|
31
|
-
|
32
|
-
|
33
|
-
|
24
|
+
it 'correctly parses options' do
|
25
|
+
subject.host.should == '127.0.0.1'
|
26
|
+
subject.port.should == 6379
|
27
|
+
subject.db.should == 0
|
34
28
|
end
|
35
|
-
end
|
36
29
|
|
30
|
+
its(:id) { should == url }
|
31
|
+
end
|
37
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mock_redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-10-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|