mock_redis 0.5.0 → 0.5.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.
@@ -1,3 +1,6 @@
1
+ ### 0.5.1
2
+ * Support `MockRedis.connect`
3
+
1
4
  ### 0.5.0
2
5
  * Support `redis-rb` >= 3.0
3
6
  * Support Redis::Distributed
@@ -23,6 +23,10 @@ class MockRedis
23
23
  :db => 0,
24
24
  }
25
25
 
26
+ def self.connect(*args)
27
+ new(*args)
28
+ end
29
+
26
30
  def initialize(*args)
27
31
  @options = _parse_options(args.first)
28
32
 
@@ -1,3 +1,3 @@
1
1
  class MockRedis
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  end
@@ -16,6 +16,22 @@ describe MockRedis do
16
16
  it "should have an id equal to redis url" do
17
17
  @mock.id.should == "redis://127.0.0.1:6379/1"
18
18
  end
19
+
20
+ context "when connecting to redis" do
21
+ before do
22
+ @mock = MockRedis.connect(:url => "redis://127.0.0.1:6379/0")
23
+ end
24
+
25
+ it "should correctly parse options" do
26
+ @mock.host.should == "127.0.0.1"
27
+ @mock.port.should == 6379
28
+ @mock.db.should == 0
29
+ end
30
+
31
+ it "should have an id equal to redis url" do
32
+ @mock.id.should == "redis://127.0.0.1:6379/0"
33
+ end
34
+ end
19
35
  end
20
36
 
21
37
  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.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-08-27 00:00:00.000000000 Z
13
+ date: 2012-09-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -224,18 +224,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
224
224
  - - ! '>='
225
225
  - !ruby/object:Gem::Version
226
226
  version: '0'
227
- segments:
228
- - 0
229
- hash: 2382509530287634625
230
227
  required_rubygems_version: !ruby/object:Gem::Requirement
231
228
  none: false
232
229
  requirements:
233
230
  - - ! '>='
234
231
  - !ruby/object:Gem::Version
235
232
  version: '0'
236
- segments:
237
- - 0
238
- hash: 2382509530287634625
239
233
  requirements: []
240
234
  rubyforge_project:
241
235
  rubygems_version: 1.8.23
@@ -361,3 +355,4 @@ test_files:
361
355
  - spec/support/shared_examples/only_operates_on_strings.rb
362
356
  - spec/support/shared_examples/only_operates_on_zsets.rb
363
357
  - spec/transactions_spec.rb
358
+ has_rdoc: