mock_redis 0.12.0 → 0.12.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 516b9db310fcc1afb4836e614d64d2e6eaf182be
4
- data.tar.gz: 346ab1f34936cd9b19387912c34c694d27ef1ff9
3
+ metadata.gz: 9c44bae9b73824aa1ed4b8a5e745d45f1b511dab
4
+ data.tar.gz: b055a6c704f08fba3ba9910bf75b953ec2bb4a1f
5
5
  SHA512:
6
- metadata.gz: 2c4e3966c3ad7feba84548c6591aa55bbf7c1fe3d01d8051da4b1be41749fe23afb02475ba176bd7fad4d3ed761be2bbdbf511151c80c74ed9e1b3b133b7b7a6
7
- data.tar.gz: df2c5def2bd41aba2671033ee2064dfbf31a5dabaf21ba5ba9a578200623648ef7d3a8c1b92e64a0d63b35af2bc00dd30c856afb6b4b07704b428a44324ba1d2
6
+ metadata.gz: 247bdc2430fad048264a198fc2d023b08df49e89ba2563693bc4b131cbf675079499236f8cd4e9c3bfc3a6c720bc400a0427722b6faf4d8abf2ac5ee097f34f0
7
+ data.tar.gz: 20d485098a4c0b402c18addd39fa68d949068e3cade53e35b850f84ad1d262e44b64de72c8a83337ec5c4eace639c014fcaa875ad515f709da7beaad9a313d47
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # MockRedis Changelog
2
2
 
3
+ ### 0.12.1
4
+
5
+ * RENAME command now keeps key expiration
6
+
3
7
  ### 0.12.0
4
8
 
5
9
  * Fix bug where `del` would not raise error when given empty array
data/README.md CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/mock_redis.png)](http://badge.fury.io/rb/mock_redis)
4
4
  [![Build Status](https://travis-ci.org/causes/mock_redis.png)](https://travis-ci.org/causes/mock_redis)
5
-
6
- A mock redis gem.
5
+ [![Dependency Status](https://gemnasium.com/causes/mock_redis.svg)](https://gemnasium.com/causes/mock_redis)
7
6
 
8
7
  MockRedis provides the same interface as `redis-rb`, but it stores its
9
8
  data in memory instead of talking to a Redis server. It is intended
@@ -144,6 +144,10 @@ class MockRedis
144
144
  raise Redis::CommandError, "ERR source and destination objects are the same"
145
145
  end
146
146
  data[newkey] = data.delete(key)
147
+ if has_expiration?(key)
148
+ set_expiration(newkey, expiration(key))
149
+ remove_expiration(key)
150
+ end
147
151
  'OK'
148
152
  end
149
153
 
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  class MockRedis
3
- VERSION = '0.12.0'
3
+ VERSION = '0.12.1'
4
4
  end
@@ -35,4 +35,10 @@ describe '#rename(key, newkey)' do
35
35
  @redises.rename(@key, @newkey)
36
36
  @redises.get(@newkey).should == "oof"
37
37
  end
38
+
39
+ it "keeps expiration" do
40
+ @redises.expire(@key, 1000)
41
+ @redises.rename(@key, @newkey)
42
+ @redises.ttl(@newkey).should be > 0
43
+ end
38
44
  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.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Causes Engineering
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-08 00:00:00.000000000 Z
12
+ date: 2014-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake