mock_redis 0.15.3 → 0.15.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -2
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -1
- data/lib/mock_redis/info_method.rb +1 -1
- data/lib/mock_redis/version.rb +1 -1
- data/lib/mock_redis/zset.rb +1 -1
- data/spec/commands/zrange_spec.rb +11 -1
- data/spec/commands/zrevrange_spec.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 067542610c0d8223c9b08324c9855c036e1fe199
|
4
|
+
data.tar.gz: 4c79481ce9e4404063cda484fa8d74709d5e9171
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a14d2235b776964f5fc38ecbb77ac27c125d4436e405c4cd093697272c103c6ca934e86099053fd2be943f6cbc69d8f8cd6a01a3239080be9d5b1b747b98b402
|
7
|
+
data.tar.gz: 963c9b2b60490745a4b905a012ba6131a18b8fade75b04c0c7c5e8efa3592951e27c48c6ccf97ab47f0a1c7bd6cc6f8abf8450f890d5c537eb5e0882b589e070
|
data/.rubocop.yml
CHANGED
@@ -83,9 +83,10 @@ Style/SignalException:
|
|
83
83
|
Style/SingleLineBlockParams:
|
84
84
|
Enabled: false
|
85
85
|
|
86
|
-
#
|
86
|
+
# Disabled since as of RuboCop 0.35.1 it reports false positives for trailing
|
87
|
+
# commas in lists with a single item
|
87
88
|
Style/TrailingComma:
|
88
|
-
|
89
|
+
Enabled: false
|
89
90
|
|
90
91
|
Style/WhenThen:
|
91
92
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -81,7 +81,7 @@ class MockRedis
|
|
81
81
|
'db0' => 'keys=8,expires=0',
|
82
82
|
}
|
83
83
|
|
84
|
-
# The Ruby
|
84
|
+
# The Ruby Redis client returns commandstats differently when it's called as
|
85
85
|
# "INFO commandstats".
|
86
86
|
# rubocop:disable Metrics/LineLength
|
87
87
|
COMMAND_STATS_SOLO_INFO = {
|
data/lib/mock_redis/version.rb
CHANGED
data/lib/mock_redis/zset.rb
CHANGED
@@ -3,9 +3,9 @@ require 'spec_helper'
|
|
3
3
|
describe '#zrange(key, start, stop [, :with_scores => true])' do
|
4
4
|
before do
|
5
5
|
@key = 'mock-redis-test:zrange'
|
6
|
+
@redises.zadd(@key, 3, 'Jefferson')
|
6
7
|
@redises.zadd(@key, 1, 'Washington')
|
7
8
|
@redises.zadd(@key, 2, 'Adams')
|
8
|
-
@redises.zadd(@key, 3, 'Jefferson')
|
9
9
|
@redises.zadd(@key, 4, 'Madison')
|
10
10
|
end
|
11
11
|
|
@@ -28,6 +28,16 @@ describe '#zrange(key, start, stop [, :with_scores => true])' do
|
|
28
28
|
@redises.zrange(@key, 0, 1).should == %w[Washington Adams]
|
29
29
|
end
|
30
30
|
|
31
|
+
context 'when a subset of elements have the same score' do
|
32
|
+
before do
|
33
|
+
@redises.zadd(@key, 1, 'Martha')
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'returns the elements in ascending lexicographical order' do
|
37
|
+
@redises.zrange(@key, 0, 1).should == %w[Martha Washington]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
31
41
|
it 'returns the elements in order by score (negative indices)' do
|
32
42
|
@redises.zrange(@key, -2, -1).should == %w[Jefferson Madison]
|
33
43
|
end
|
@@ -24,6 +24,16 @@ describe '#zrevrange(key, start, stop [, :with_scores => true])' do
|
|
24
24
|
@redises.zrevrange(@key, 0, 1).should == %w[Madison Jefferson]
|
25
25
|
end
|
26
26
|
|
27
|
+
context 'when a subset of elements have the same score' do
|
28
|
+
before do
|
29
|
+
@redises.zadd(@key, 1, 'Martha')
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'returns the elements in descending lexicographical order' do
|
33
|
+
@redises.zrevrange(@key, 3, 4).should == %w[Washington Martha]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
27
37
|
it 'returns the elements in order by score (negative indices)' do
|
28
38
|
@redises.zrevrange(@key, -2, -1).should == %w[Adams Washington]
|
29
39
|
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.15.
|
4
|
+
version: 0.15.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brigade Engineering
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -265,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
265
|
version: '0'
|
266
266
|
requirements: []
|
267
267
|
rubyforge_project:
|
268
|
-
rubygems_version: 2.4.
|
268
|
+
rubygems_version: 2.4.5.1
|
269
269
|
signing_key:
|
270
270
|
specification_version: 4
|
271
271
|
summary: Redis mock that just lives in memory; useful for testing.
|