mock_redis 0.19.0 → 0.24.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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +32 -5
  3. data/.rubocop_todo.yml +1 -1
  4. data/.travis.yml +9 -10
  5. data/CHANGELOG.md +46 -0
  6. data/Gemfile +2 -2
  7. data/LICENSE.md +21 -0
  8. data/README.md +39 -15
  9. data/lib/mock_redis.rb +0 -5
  10. data/lib/mock_redis/database.rb +59 -22
  11. data/lib/mock_redis/future.rb +1 -1
  12. data/lib/mock_redis/geospatial_methods.rb +14 -22
  13. data/lib/mock_redis/hash_methods.rb +23 -15
  14. data/lib/mock_redis/indifferent_hash.rb +0 -8
  15. data/lib/mock_redis/info_method.rb +2 -2
  16. data/lib/mock_redis/list_methods.rb +2 -2
  17. data/lib/mock_redis/multi_db_wrapper.rb +2 -2
  18. data/lib/mock_redis/pipelined_wrapper.rb +25 -6
  19. data/lib/mock_redis/set_methods.rb +16 -4
  20. data/lib/mock_redis/stream.rb +62 -0
  21. data/lib/mock_redis/stream/id.rb +60 -0
  22. data/lib/mock_redis/stream_methods.rb +87 -0
  23. data/lib/mock_redis/string_methods.rb +31 -20
  24. data/lib/mock_redis/transaction_wrapper.rb +27 -14
  25. data/lib/mock_redis/utility_methods.rb +6 -3
  26. data/lib/mock_redis/version.rb +1 -1
  27. data/lib/mock_redis/zset_methods.rb +54 -11
  28. data/mock_redis.gemspec +6 -6
  29. data/spec/client_spec.rb +12 -0
  30. data/spec/commands/blpop_spec.rb +0 -6
  31. data/spec/commands/brpop_spec.rb +6 -5
  32. data/spec/commands/dump_spec.rb +19 -0
  33. data/spec/commands/exists_spec.rb +34 -5
  34. data/spec/commands/future_spec.rb +11 -1
  35. data/spec/commands/geoadd_spec.rb +1 -1
  36. data/spec/commands/geodist_spec.rb +8 -4
  37. data/spec/commands/geohash_spec.rb +4 -4
  38. data/spec/commands/geopos_spec.rb +4 -4
  39. data/spec/commands/get_spec.rb +1 -0
  40. data/spec/commands/hdel_spec.rb +18 -2
  41. data/spec/commands/hmset_spec.rb +26 -0
  42. data/spec/commands/hset_spec.rb +6 -6
  43. data/spec/commands/keys_spec.rb +17 -0
  44. data/spec/commands/mget_spec.rb +34 -15
  45. data/spec/commands/move_spec.rb +5 -5
  46. data/spec/commands/mset_spec.rb +14 -0
  47. data/spec/commands/pipelined_spec.rb +72 -0
  48. data/spec/commands/restore_spec.rb +47 -0
  49. data/spec/commands/scan_spec.rb +9 -0
  50. data/spec/commands/set_spec.rb +12 -2
  51. data/spec/commands/setbit_spec.rb +1 -0
  52. data/spec/commands/setex_spec.rb +16 -0
  53. data/spec/commands/spop_spec.rb +15 -0
  54. data/spec/commands/srandmember_spec.rb +1 -1
  55. data/spec/commands/srem_spec.rb +5 -0
  56. data/spec/commands/watch_spec.rb +8 -3
  57. data/spec/commands/xadd_spec.rb +104 -0
  58. data/spec/commands/xlen_spec.rb +20 -0
  59. data/spec/commands/xrange_spec.rb +141 -0
  60. data/spec/commands/xrevrange_spec.rb +130 -0
  61. data/spec/commands/xtrim_spec.rb +30 -0
  62. data/spec/commands/zinterstore_spec.rb +34 -0
  63. data/spec/commands/zpopmax_spec.rb +60 -0
  64. data/spec/commands/zpopmin_spec.rb +60 -0
  65. data/spec/commands/zrange_spec.rb +1 -1
  66. data/spec/commands/zrangebyscore_spec.rb +1 -1
  67. data/spec/commands/zrevrange_spec.rb +1 -1
  68. data/spec/commands/zrevrangebyscore_spec.rb +1 -1
  69. data/spec/commands/zunionstore_spec.rb +33 -0
  70. data/spec/mock_redis_spec.rb +4 -6
  71. data/spec/spec_helper.rb +6 -2
  72. data/spec/support/redis_multiplexer.rb +18 -1
  73. data/spec/support/shared_examples/does_not_cleanup_empty_strings.rb +14 -0
  74. data/spec/support/shared_examples/only_operates_on_hashes.rb +2 -0
  75. data/spec/support/shared_examples/only_operates_on_lists.rb +2 -0
  76. data/spec/support/shared_examples/only_operates_on_sets.rb +2 -0
  77. data/spec/support/shared_examples/only_operates_on_zsets.rb +2 -0
  78. data/spec/transactions_spec.rb +30 -26
  79. metadata +45 -31
  80. data/LICENSE +0 -19
  81. data/spec/commands/hash_operator_spec.rb +0 -21
@@ -15,7 +15,7 @@ describe '#zrange(key, start, stop [, :with_scores => true])' do
15
15
  end
16
16
 
17
17
  it 'should return an empty array' do
18
- @redises.exists(@key).should == false
18
+ @redises.exists?(@key).should == false
19
19
  @redises.zrange(@key, 0, 4).should == []
20
20
  end
21
21
  end
@@ -15,7 +15,7 @@ describe '#zrangebyscore(key, start, stop [:with_scores => true] [:limit => [off
15
15
  end
16
16
 
17
17
  it 'should return an empty array' do
18
- @redises.exists(@key).should == false
18
+ @redises.exists?(@key).should == false
19
19
  @redises.zrangebyscore(@key, 0, 4).should == []
20
20
  end
21
21
  end
@@ -15,7 +15,7 @@ describe '#zrevrange(key, start, stop [, :with_scores => true])' do
15
15
  end
16
16
 
17
17
  it 'should return an empty array' do
18
- @redises.exists(@key).should == false
18
+ @redises.exists?(@key).should == false
19
19
  @redises.zrevrange(@key, 0, 4).should == []
20
20
  end
21
21
  end
@@ -15,7 +15,7 @@ describe '#zrevrangebyscore(key, start, stop [:with_scores => true] [:limit => [
15
15
  end
16
16
 
17
17
  it 'should return an empty array' do
18
- @redises.exists(@key).should == false
18
+ @redises.exists?(@key).should == false
19
19
  @redises.zrevrangebyscore(@key, 0, 4).should == []
20
20
  end
21
21
  end
@@ -41,6 +41,39 @@ describe '#zunionstore(destination, keys, [:weights => [w,w,], [:aggregate => :s
41
41
  end.should raise_error(Redis::CommandError)
42
42
  end
43
43
 
44
+ context 'when used with a set' do
45
+ before do
46
+ @set4 = 'mock-redis-test:zunionstore4'
47
+
48
+ @redises.sadd(@set4, 'two')
49
+ @redises.sadd(@set4, 'three')
50
+ @redises.sadd(@set4, 'four')
51
+ end
52
+
53
+ it 'returns the number of elements in the new set' do
54
+ @redises.zunionstore(@dest, [@set3, @set4]).should == 4
55
+ end
56
+
57
+ it 'sums the scores, substituting 1.0 for set values' do
58
+ @redises.zunionstore(@dest, [@set3, @set4])
59
+ @redises.zrange(@dest, 0, -1, :with_scores => true).should ==
60
+ [['four', 1.0], ['one', 1.0], ['two', 3.0], ['three', 4.0]]
61
+ end
62
+ end
63
+
64
+ context 'when used with a non-coercible structure' do
65
+ before do
66
+ @non_set = 'mock-redis-test:zunionstore4'
67
+
68
+ @redises.set(@non_set, 'one')
69
+ end
70
+ it 'raises an error for wrong value type' do
71
+ lambda do
72
+ @redises.zunionstore(@dest, [@set1, @non_set])
73
+ end.should raise_error(Redis::CommandError)
74
+ end
75
+ end
76
+
44
77
  context 'the :weights argument' do
45
78
  it 'multiplies the scores by the weights while aggregating' do
46
79
  @redises.zunionstore(@dest, [@set1, @set2, @set3], :weights => [2, 3, 5])
@@ -49,23 +49,21 @@ describe MockRedis do
49
49
  end
50
50
 
51
51
  describe '.now' do
52
- let(:now) { 'Now' }
53
- let(:time_stub) { double 'Time', :now => now }
52
+ let(:time_stub) { double 'Time', :now => Time.new(2019, 1, 2, 3, 4, 6, '+00:00') }
54
53
  let(:options) { { :time_class => time_stub } }
55
54
 
56
55
  subject { MockRedis.new(options) }
57
56
 
58
- its(:now) { should == now }
57
+ its(:now) { should == [1_546_398_246, 0] }
59
58
  end
60
59
 
61
60
  describe '.time' do
62
- let(:now) { 'Now' }
63
- let(:time_stub) { double 'Time', :now => now }
61
+ let(:time_stub) { double 'Time', :now => Time.new(2019, 1, 2, 3, 4, 6, '+00:00') }
64
62
  let(:options) { { :time_class => time_stub } }
65
63
 
66
64
  subject { MockRedis.new(options) }
67
65
 
68
- its(:time) { should == now }
66
+ its(:time) { should == [1_546_398_246, 0] }
69
67
  end
70
68
 
71
69
  describe '.expireat' do
@@ -12,9 +12,10 @@ require 'rspec/its'
12
12
  require 'redis'
13
13
  $LOAD_PATH.unshift(File.expand_path(File.join(__FILE__, '..', '..', 'lib')))
14
14
  require 'mock_redis'
15
+ require 'timecop'
15
16
 
16
17
  $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..')))
17
- Dir['spec/support/**/*.rb'].each { |x| require x }
18
+ Dir['spec/support/**/*.rb'].sort.each { |x| require x }
18
19
 
19
20
  module TypeCheckingHelper
20
21
  def method_from_description(example)
@@ -26,7 +27,7 @@ module TypeCheckingHelper
26
27
  end
27
28
 
28
29
  def args_for_method(method)
29
- return [] if method.to_s == 'spop'
30
+ return [] if %w[spop zpopmin zpopmax].include?(method.to_s)
30
31
  method_arity = @redises.real.method(method).arity
31
32
  if method_arity < 0 # -1 comes from def foo(*args)
32
33
  [1, 2] # probably good enough
@@ -39,6 +40,8 @@ end
39
40
  RSpec.configure do |config|
40
41
  config.expect_with :rspec do |c|
41
42
  c.syntax = [:expect, :should]
43
+ # Allow for a large output so we can debug error messages
44
+ c.max_formatted_output_length = 1_000_000
42
45
  end
43
46
 
44
47
  config.mock_with :rspec do |c|
@@ -59,5 +62,6 @@ RSpec.configure do |config|
59
62
  @redises.send_without_checking(:del, key)
60
63
  end
61
64
  end
65
+ @redises._gsub_clear
62
66
  end
63
67
  end
@@ -9,7 +9,18 @@ class RedisMultiplexer < BlankSlate
9
9
 
10
10
  def initialize(*a)
11
11
  @mock_redis = MockRedis.new(*a)
12
+ Redis.exists_returns_integer = true
12
13
  @real_redis = Redis.new(*a)
14
+ _gsub_clear
15
+ end
16
+
17
+ def _gsub(from, to)
18
+ @gsub_from = from
19
+ @gsub_to = to
20
+ end
21
+
22
+ def _gsub_clear
23
+ @gsub_from = @gsub_to = ''
13
24
  end
14
25
 
15
26
  def method_missing(method, *args, &blk)
@@ -71,8 +82,10 @@ class RedisMultiplexer < BlankSlate
71
82
  def equalish?(a, b)
72
83
  if a == b
73
84
  true
85
+ elsif a.is_a?(String) && b.is_a?(String)
86
+ masked(a) == masked(b)
74
87
  elsif a.is_a?(Array) && b.is_a?(Array)
75
- a.collect(&:to_s).sort == b.collect(&:to_s).sort
88
+ a.collect { |c| masked(c.to_s) }.sort == b.collect { |c| masked(c.to_s) }.sort
76
89
  elsif a.is_a?(Exception) && b.is_a?(Exception)
77
90
  a.class == b.class && a.message == b.message
78
91
  elsif a.is_a?(Float) && b.is_a?(Float)
@@ -83,6 +96,10 @@ class RedisMultiplexer < BlankSlate
83
96
  end
84
97
  end
85
98
 
99
+ def masked(str)
100
+ str.gsub(@gsub_from, @gsub_to)
101
+ end
102
+
86
103
  def mock
87
104
  @mock_redis
88
105
  end
@@ -0,0 +1,14 @@
1
+ shared_examples_for 'does not remove empty strings on error' do
2
+ it 'does not remove empty strings on error' do |example|
3
+ key = 'mock-redis-test:not-a-string'
4
+
5
+ method = method_from_description(example)
6
+ args = args_for_method(method).unshift(key)
7
+
8
+ @redises.set(key, '')
9
+ lambda do
10
+ @redises.send(method, *args)
11
+ end.should raise_error(RuntimeError)
12
+ @redises.get(key).should == ''
13
+ end
14
+ end
@@ -10,4 +10,6 @@ shared_examples_for 'a hash-only command' do
10
10
  @redises.send(method, *args)
11
11
  end.should raise_error(RuntimeError)
12
12
  end
13
+
14
+ it_should_behave_like 'does not remove empty strings on error'
13
15
  end
@@ -10,4 +10,6 @@ shared_examples_for 'a list-only command' do
10
10
  @redises.send(method, *args)
11
11
  end.should raise_error(RuntimeError)
12
12
  end
13
+
14
+ it_should_behave_like 'does not remove empty strings on error'
13
15
  end
@@ -10,4 +10,6 @@ shared_examples_for 'a set-only command' do
10
10
  @redises.send(method, *args)
11
11
  end.should raise_error(RuntimeError)
12
12
  end
13
+
14
+ it_should_behave_like 'does not remove empty strings on error'
13
15
  end
@@ -10,6 +10,8 @@ shared_examples_for 'a zset-only command' do
10
10
  @redises.send(method, *args)
11
11
  end.should raise_error(RuntimeError)
12
12
  end
13
+
14
+ it_should_behave_like 'does not remove empty strings on error'
13
15
  end
14
16
 
15
17
  shared_examples_for 'arg 1 is a score' do
@@ -10,11 +10,11 @@ describe 'transactions (multi/exec/discard)' do
10
10
  @redises.multi.should == 'OK'
11
11
  end
12
12
 
13
- it 'forbids nesting' do
13
+ it 'does not permit nesting' do
14
14
  @redises.multi
15
15
  lambda do
16
16
  @redises.multi
17
- end.should raise_error(Redis::CommandError)
17
+ end.should raise_error(Redis::CommandError, 'ERR MULTI calls can not be nested')
18
18
  end
19
19
 
20
20
  it 'cleans state of transaction wrapper if exception occurs during transaction' do
@@ -41,18 +41,18 @@ describe 'transactions (multi/exec/discard)' do
41
41
  r.set('test', 1)
42
42
  r.incr('counter')
43
43
  end
44
- @redises.get('counter').should == '6'
45
- @redises.get('test').should == '1'
44
+ @redises.get('counter').should eq '6'
45
+ @redises.get('test').should eq '1'
46
46
  end
47
47
 
48
- it 'forbids nesting via blocks' do
48
+ it 'permits nesting via blocks' do
49
49
  # Have to use only the mock here. redis-rb has a bug in it where
50
50
  # nested #multi calls raise NoMethodError because it gets a nil
51
51
  # where it's not expecting one.
52
52
  @redises.mock.multi do |r|
53
53
  lambda do
54
54
  r.multi {}
55
- end.should raise_error(Redis::CommandError)
55
+ end.should_not raise_error
56
56
  end
57
57
  end
58
58
 
@@ -64,27 +64,31 @@ describe 'transactions (multi/exec/discard)' do
64
64
  pr.incr('counter')
65
65
  end
66
66
  end
67
- @redises.get('counter').should == '6'
68
- @redises.get('test').should == '1'
67
+ @redises.get('counter').should eq '6'
68
+ @redises.get('test').should eq '1'
69
69
  end
70
70
 
71
- it 'allows multi blocks within pipelined blocks' do
72
- @redises.set('counter', 5)
73
- @redises.pipelined do |pr|
74
- pr.multi do |r|
75
- r.set('test', 1)
76
- r.incr('counter')
77
- end
71
+ it 'allows blocks within multi blocks' do
72
+ @redises.set('foo', 'bar')
73
+ @redises.set('fuu', 'baz')
74
+
75
+ result = nil
76
+
77
+ @redises.multi do |r|
78
+ result = r.mget('foo', 'fuu') { |reply| reply.map(&:upcase) }
79
+ r.del('foo', 'fuu')
78
80
  end
79
- @redises.get('counter').should == '6'
80
- @redises.get('test').should == '1'
81
+
82
+ result.value.should eq %w[BAR BAZ]
83
+ @redises.get('foo').should eq nil
84
+ @redises.get('fuu').should eq nil
81
85
  end
82
86
  end
83
87
 
84
88
  context '#discard' do
85
89
  it "responds with 'OK' after #multi" do
86
90
  @redises.multi
87
- @redises.discard.should == 'OK'
91
+ @redises.discard.should eq 'OK'
88
92
  end
89
93
 
90
94
  it "can't be run outside of #multi/#exec" do
@@ -110,8 +114,8 @@ describe 'transactions (multi/exec/discard)' do
110
114
  end
111
115
 
112
116
  it "makes commands respond with 'QUEUED'" do
113
- @redises.set(@string, 'string').should == 'QUEUED'
114
- @redises.lpush(@list, 'list').should == 'QUEUED'
117
+ @redises.set(@string, 'string').should eq 'QUEUED'
118
+ @redises.lpush(@list, 'list').should eq 'QUEUED'
115
119
  end
116
120
 
117
121
  it "gives you the commands' responses when you call #exec" do
@@ -119,7 +123,7 @@ describe 'transactions (multi/exec/discard)' do
119
123
  @redises.lpush(@list, 'list')
120
124
  @redises.lpush(@list, 'list')
121
125
 
122
- @redises.exec.should == ['OK', 1, 2]
126
+ @redises.exec.should eq ['OK', 1, 2]
123
127
  end
124
128
 
125
129
  it "does not raise exceptions, but rather puts them in #exec's response" do
@@ -128,9 +132,9 @@ describe 'transactions (multi/exec/discard)' do
128
132
  @redises.lpush(@list, 'list')
129
133
 
130
134
  responses = @redises.exec
131
- responses[0].should == 'OK'
135
+ responses[0].should eq 'OK'
132
136
  responses[1].should be_a(Redis::CommandError)
133
- responses[2].should == 1
137
+ responses[2].should eq 1
134
138
  end
135
139
  end
136
140
 
@@ -151,9 +155,9 @@ describe 'transactions (multi/exec/discard)' do
151
155
  second_lpush_response = mult.lpush(@list, 'list')
152
156
  end
153
157
 
154
- set_response.value.should == 'OK'
155
- lpush_response.value.should == 1
156
- second_lpush_response.value.should == 2
158
+ set_response.value.should eq 'OK'
159
+ lpush_response.value.should eq 1
160
+ second_lpush_response.value.should eq 2
157
161
  end
158
162
  end
159
163
  end
metadata CHANGED
@@ -1,82 +1,76 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mock_redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
- - Brigade Engineering
7
+ - Shane da Silva
8
8
  - Samuel Merritt
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-03 00:00:00.000000000 Z
12
+ date: 2020-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rake
15
+ name: redis
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: '10'
21
- - - "<"
18
+ - - "~>"
22
19
  - !ruby/object:Gem::Version
23
- version: '12'
20
+ version: 4.2.0
24
21
  type: :development
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- version: '10'
31
- - - "<"
25
+ - - "~>"
32
26
  - !ruby/object:Gem::Version
33
- version: '12'
27
+ version: 4.2.0
34
28
  - !ruby/object:Gem::Dependency
35
- name: redis
29
+ name: rspec
36
30
  requirement: !ruby/object:Gem::Requirement
37
31
  requirements:
38
32
  - - "~>"
39
33
  - !ruby/object:Gem::Version
40
- version: 3.3.0
34
+ version: '3.0'
41
35
  type: :development
42
36
  prerelease: false
43
37
  version_requirements: !ruby/object:Gem::Requirement
44
38
  requirements:
45
39
  - - "~>"
46
40
  - !ruby/object:Gem::Version
47
- version: 3.3.0
41
+ version: '3.0'
48
42
  - !ruby/object:Gem::Dependency
49
- name: rspec
43
+ name: rspec-its
50
44
  requirement: !ruby/object:Gem::Requirement
51
45
  requirements:
52
46
  - - "~>"
53
47
  - !ruby/object:Gem::Version
54
- version: '3.0'
48
+ version: '1.0'
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
52
  requirements:
59
53
  - - "~>"
60
54
  - !ruby/object:Gem::Version
61
- version: '3.0'
55
+ version: '1.0'
62
56
  - !ruby/object:Gem::Dependency
63
- name: rspec-its
57
+ name: timecop
64
58
  requirement: !ruby/object:Gem::Requirement
65
59
  requirements:
66
60
  - - "~>"
67
61
  - !ruby/object:Gem::Version
68
- version: '1.0'
62
+ version: 0.9.1
69
63
  type: :development
70
64
  prerelease: false
71
65
  version_requirements: !ruby/object:Gem::Requirement
72
66
  requirements:
73
67
  - - "~>"
74
68
  - !ruby/object:Gem::Version
75
- version: '1.0'
69
+ version: 0.9.1
76
70
  description: Instantiate one with `redis = MockRedis.new` and treat it like you would
77
71
  a normal Redis object. It supports all the usual Redis operations.
78
72
  email:
79
- - eng@brigade.com
73
+ - shane@dasilva.io
80
74
  executables: []
81
75
  extensions: []
82
76
  extra_rdoc_files: []
@@ -91,7 +85,7 @@ files:
91
85
  - ".travis.yml"
92
86
  - CHANGELOG.md
93
87
  - Gemfile
94
- - LICENSE
88
+ - LICENSE.md
95
89
  - README.md
96
90
  - Rakefile
97
91
  - lib/mock_redis.rb
@@ -109,6 +103,9 @@ files:
109
103
  - lib/mock_redis/pipelined_wrapper.rb
110
104
  - lib/mock_redis/set_methods.rb
111
105
  - lib/mock_redis/sort_method.rb
106
+ - lib/mock_redis/stream.rb
107
+ - lib/mock_redis/stream/id.rb
108
+ - lib/mock_redis/stream_methods.rb
112
109
  - lib/mock_redis/string_methods.rb
113
110
  - lib/mock_redis/transaction_wrapper.rb
114
111
  - lib/mock_redis/undef_redis_methods.rb
@@ -134,6 +131,7 @@ files:
134
131
  - spec/commands/decrby_spec.rb
135
132
  - spec/commands/del_spec.rb
136
133
  - spec/commands/disconnect_spec.rb
134
+ - spec/commands/dump_spec.rb
137
135
  - spec/commands/echo_spec.rb
138
136
  - spec/commands/eval_spec.rb
139
137
  - spec/commands/evalsha_spec.rb
@@ -151,7 +149,6 @@ files:
151
149
  - spec/commands/getbit_spec.rb
152
150
  - spec/commands/getrange_spec.rb
153
151
  - spec/commands/getset_spec.rb
154
- - spec/commands/hash_operator_spec.rb
155
152
  - spec/commands/hdel_spec.rb
156
153
  - spec/commands/hexists_spec.rb
157
154
  - spec/commands/hget_spec.rb
@@ -202,6 +199,7 @@ files:
202
199
  - spec/commands/randomkey_spec.rb
203
200
  - spec/commands/rename_spec.rb
204
201
  - spec/commands/renamenx_spec.rb
202
+ - spec/commands/restore_spec.rb
205
203
  - spec/commands/rpop_spec.rb
206
204
  - spec/commands/rpoplpush_spec.rb
207
205
  - spec/commands/rpush_spec.rb
@@ -240,11 +238,18 @@ files:
240
238
  - spec/commands/type_spec.rb
241
239
  - spec/commands/unwatch_spec.rb
242
240
  - spec/commands/watch_spec.rb
241
+ - spec/commands/xadd_spec.rb
242
+ - spec/commands/xlen_spec.rb
243
+ - spec/commands/xrange_spec.rb
244
+ - spec/commands/xrevrange_spec.rb
245
+ - spec/commands/xtrim_spec.rb
243
246
  - spec/commands/zadd_spec.rb
244
247
  - spec/commands/zcard_spec.rb
245
248
  - spec/commands/zcount_spec.rb
246
249
  - spec/commands/zincrby_spec.rb
247
250
  - spec/commands/zinterstore_spec.rb
251
+ - spec/commands/zpopmax_spec.rb
252
+ - spec/commands/zpopmin_spec.rb
248
253
  - spec/commands/zrange_spec.rb
249
254
  - spec/commands/zrangebyscore_spec.rb
250
255
  - spec/commands/zrank_spec.rb
@@ -261,6 +266,7 @@ files:
261
266
  - spec/mock_redis_spec.rb
262
267
  - spec/spec_helper.rb
263
268
  - spec/support/redis_multiplexer.rb
269
+ - spec/support/shared_examples/does_not_cleanup_empty_strings.rb
264
270
  - spec/support/shared_examples/only_operates_on_hashes.rb
265
271
  - spec/support/shared_examples/only_operates_on_lists.rb
266
272
  - spec/support/shared_examples/only_operates_on_sets.rb
@@ -268,7 +274,7 @@ files:
268
274
  - spec/support/shared_examples/only_operates_on_zsets.rb
269
275
  - spec/support/shared_examples/sorts_enumerables.rb
270
276
  - spec/transactions_spec.rb
271
- homepage: https://github.com/brigade/mock_redis
277
+ homepage: https://github.com/sds/mock_redis
272
278
  licenses:
273
279
  - MIT
274
280
  metadata: {}
@@ -280,15 +286,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
280
286
  requirements:
281
287
  - - ">="
282
288
  - !ruby/object:Gem::Version
283
- version: '2.2'
289
+ version: '2.4'
284
290
  required_rubygems_version: !ruby/object:Gem::Requirement
285
291
  requirements:
286
292
  - - ">="
287
293
  - !ruby/object:Gem::Version
288
294
  version: '0'
289
295
  requirements: []
290
- rubyforge_project:
291
- rubygems_version: 2.7.3
296
+ rubygems_version: 3.1.1
292
297
  signing_key:
293
298
  specification_version: 4
294
299
  summary: Redis mock that just lives in memory; useful for testing.
@@ -310,6 +315,7 @@ test_files:
310
315
  - spec/commands/decrby_spec.rb
311
316
  - spec/commands/del_spec.rb
312
317
  - spec/commands/disconnect_spec.rb
318
+ - spec/commands/dump_spec.rb
313
319
  - spec/commands/echo_spec.rb
314
320
  - spec/commands/eval_spec.rb
315
321
  - spec/commands/evalsha_spec.rb
@@ -327,7 +333,6 @@ test_files:
327
333
  - spec/commands/getbit_spec.rb
328
334
  - spec/commands/getrange_spec.rb
329
335
  - spec/commands/getset_spec.rb
330
- - spec/commands/hash_operator_spec.rb
331
336
  - spec/commands/hdel_spec.rb
332
337
  - spec/commands/hexists_spec.rb
333
338
  - spec/commands/hget_spec.rb
@@ -378,6 +383,7 @@ test_files:
378
383
  - spec/commands/randomkey_spec.rb
379
384
  - spec/commands/rename_spec.rb
380
385
  - spec/commands/renamenx_spec.rb
386
+ - spec/commands/restore_spec.rb
381
387
  - spec/commands/rpop_spec.rb
382
388
  - spec/commands/rpoplpush_spec.rb
383
389
  - spec/commands/rpush_spec.rb
@@ -416,11 +422,18 @@ test_files:
416
422
  - spec/commands/type_spec.rb
417
423
  - spec/commands/unwatch_spec.rb
418
424
  - spec/commands/watch_spec.rb
425
+ - spec/commands/xadd_spec.rb
426
+ - spec/commands/xlen_spec.rb
427
+ - spec/commands/xrange_spec.rb
428
+ - spec/commands/xrevrange_spec.rb
429
+ - spec/commands/xtrim_spec.rb
419
430
  - spec/commands/zadd_spec.rb
420
431
  - spec/commands/zcard_spec.rb
421
432
  - spec/commands/zcount_spec.rb
422
433
  - spec/commands/zincrby_spec.rb
423
434
  - spec/commands/zinterstore_spec.rb
435
+ - spec/commands/zpopmax_spec.rb
436
+ - spec/commands/zpopmin_spec.rb
424
437
  - spec/commands/zrange_spec.rb
425
438
  - spec/commands/zrangebyscore_spec.rb
426
439
  - spec/commands/zrank_spec.rb
@@ -437,6 +450,7 @@ test_files:
437
450
  - spec/mock_redis_spec.rb
438
451
  - spec/spec_helper.rb
439
452
  - spec/support/redis_multiplexer.rb
453
+ - spec/support/shared_examples/does_not_cleanup_empty_strings.rb
440
454
  - spec/support/shared_examples/only_operates_on_hashes.rb
441
455
  - spec/support/shared_examples/only_operates_on_lists.rb
442
456
  - spec/support/shared_examples/only_operates_on_sets.rb