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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9b8fbf2e49de0035f66b1a031ec57f0fcb7c345
4
- data.tar.gz: bcfb198f89ff3d10d337ccb671a3c22ced9b2b0e
3
+ metadata.gz: 067542610c0d8223c9b08324c9855c036e1fe199
4
+ data.tar.gz: 4c79481ce9e4404063cda484fa8d74709d5e9171
5
5
  SHA512:
6
- metadata.gz: d51552e4d5fe5da840df548d3ffaff4f3134c8674a34ca125a22a0a2682a85cdff92d2462a2f3d061e955563c8eb8a48cabafda9df5b4c6e60305f7879e9d9f1
7
- data.tar.gz: 0e11ba27a49115af5b3fd847f87522f7a11a08d04413a23a7594877a3a5f53aed24766018ae4f6e5c6efdd83e1198390eaea1fb54f10755026759850d5c2b3ad
6
+ metadata.gz: a14d2235b776964f5fc38ecbb77ac27c125d4436e405c4cd093697272c103c6ca934e86099053fd2be943f6cbc69d8f8cd6a01a3239080be9d5b1b747b98b402
7
+ data.tar.gz: 963c9b2b60490745a4b905a012ba6131a18b8fade75b04c0c7c5e8efa3592951e27c48c6ccf97ab47f0a1c7bd6cc6f8abf8450f890d5c537eb5e0882b589e070
@@ -83,9 +83,10 @@ Style/SignalException:
83
83
  Style/SingleLineBlockParams:
84
84
  Enabled: false
85
85
 
86
- # End last item of a muli-line list with a comma for better diffs in future
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
- EnforcedStyleForMultiline: comma
89
+ Enabled: false
89
90
 
90
91
  Style/WhenThen:
91
92
  Enabled: false
@@ -1,5 +1,10 @@
1
1
  # MockRedis Changelog
2
2
 
3
+ ### 0.15.4
4
+
5
+ * Fix `zrange`/`zrevrange` to return elements with equal values in
6
+ lexicographic order
7
+
3
8
  ### 0.15.3
4
9
 
5
10
  * Fix `sadd` to return integers when adding arrays
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gemspec
7
7
  gem 'overcommit', '0.28.0'
8
8
 
9
9
  # Pin tool versions (which are executed by Overcommit) for Travis builds
10
- gem 'rubocop', '0.34.2'
10
+ gem 'rubocop', '0.35.1'
11
11
  gem 'travis', '~> 1.7'
12
12
 
13
13
  gem 'coveralls', require: false
@@ -81,7 +81,7 @@ class MockRedis
81
81
  'db0' => 'keys=8,expires=0',
82
82
  }
83
83
 
84
- # The Ruby Reids client returns commandstats differently when it's called as
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 = {
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  class MockRedis
3
- VERSION = '0.15.3'
3
+ VERSION = '0.15.4'
4
4
  end
@@ -88,7 +88,7 @@ class MockRedis
88
88
  def sorted
89
89
  members.map do |m|
90
90
  [score(m), m]
91
- end.sort_by(&:first)
91
+ end.sort
92
92
  end
93
93
 
94
94
  def sorted_members
@@ -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.3
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-09-24 00:00:00.000000000 Z
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.8
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.