ryansch-mock_redis 0.2.0.1 → 0.2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,10 @@ class MockRedis
6
6
  begin
7
7
  send(assertion, key)
8
8
  data[key] ||= empty_thing_generator.call
9
- yield data[key]
9
+ data_key_ref = data[key]
10
+ ret = yield data[key]
11
+ data[key] = data_key_ref if data[key].nil?
12
+ ret
10
13
  ensure
11
14
  clean_up_empties_at(key)
12
15
  end
@@ -1,3 +1,3 @@
1
1
  class MockRedis
2
- VERSION = "0.2.0.1"
2
+ VERSION = "0.2.0.2"
3
3
  end
@@ -33,6 +33,12 @@ describe '#sunionstore(destination, key [, key, ...])' do
33
33
  @redises.smembers(@destination).should == %w[2 3 5 7]
34
34
  end
35
35
 
36
+ it "correctly unions and stores when the destination is empty and is one of the arguments" do
37
+ @redises.sunionstore(@destination, @destination, @primes)
38
+
39
+ @redises.smembers(@destination).should == %w[2 3 5 7]
40
+ end
41
+
36
42
  it "raises an error if given 0 sets" do
37
43
  lambda do
38
44
  @redises.sunionstore(@destination)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ryansch-mock_redis
3
3
  version: !ruby/object:Gem::Version
4
- hash: 93
4
+ hash: 91
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
9
  - 0
10
- - 1
11
- version: 0.2.0.1
10
+ - 2
11
+ version: 0.2.0.2
12
12
  platform: ruby
13
13
  authors:
14
14
  - Samuel Merritt
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-11-29 00:00:00 Z
20
+ date: 2011-12-01 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: redis