fakeredis 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/Gemfile +2 -0
- data/README.md +26 -18
- data/lib/fakeredis/strings.rb +0 -1
- data/lib/fakeredis/version.rb +1 -1
- data/spec/strings_spec.rb +6 -1
- metadata +29 -35
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,28 +1,37 @@
|
|
1
|
-
FakeRedis [![Build Status](http://travis-ci.org/guilleiguaran/fakeredis.png)](http://travis-ci.org/guilleiguaran/fakeredis)
|
2
|
-
--------
|
1
|
+
# FakeRedis [![Build Status](http://travis-ci.org/guilleiguaran/fakeredis.png)](http://travis-ci.org/guilleiguaran/fakeredis)
|
3
2
|
This a fake implementation of redis-rb for machines without Redis or test environments
|
4
3
|
|
5
|
-
Usage
|
6
|
-
=====
|
7
|
-
You can use FakeRedis::Redis similary as you use redis gem:
|
8
4
|
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install the gem:
|
8
|
+
|
9
|
+
gem install fakeredis
|
10
|
+
|
11
|
+
Add it to your Gemfile:
|
12
|
+
|
13
|
+
gem "fakeredis"
|
12
14
|
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
You can use FakeRedis::Redis similary as you use redis gem:
|
19
|
+
|
20
|
+
require "fakeredis"
|
21
|
+
|
22
|
+
redis = FakeRedis::Redis.new
|
23
|
+
|
24
|
+
>> redis.set "foo", "bar"
|
25
|
+
=> "OK"
|
26
|
+
|
27
|
+
>> redis.get "foo"
|
28
|
+
=> "bar"
|
19
29
|
|
20
30
|
Read [redis-rb](https://github.com/ezmobius/redis-rb) documentation and
|
21
31
|
[Redis](http://redis.io) homepage for more info about commands
|
22
32
|
|
23
33
|
|
24
|
-
Contributing to FakeRedis
|
25
|
-
=======================
|
34
|
+
## Contributing to FakeRedis
|
26
35
|
|
27
36
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
28
37
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
@@ -32,9 +41,8 @@ Contributing to FakeRedis
|
|
32
41
|
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
33
42
|
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
34
43
|
|
35
|
-
|
36
|
-
|
44
|
+
|
45
|
+
## Copyright
|
37
46
|
|
38
47
|
Copyright (c) 2011 Guillermo Iguaran. See LICENSE for
|
39
48
|
further details.
|
40
|
-
|
data/lib/fakeredis/strings.rb
CHANGED
data/lib/fakeredis/version.rb
CHANGED
data/spec/strings_spec.rb
CHANGED
@@ -56,8 +56,13 @@ module FakeRedis
|
|
56
56
|
@client.getset("key1", "value2").should == "value1"
|
57
57
|
@client.get("key1").should == "value2"
|
58
58
|
end
|
59
|
+
|
60
|
+
it "should return nil for #getset if the key does not exist when setting" do
|
61
|
+
@client.getset("key1", "value1").should == nil
|
62
|
+
@client.get("key1").should == "value1"
|
63
|
+
end
|
59
64
|
|
60
|
-
|
65
|
+
it "should increment the integer value of a key by one" do
|
61
66
|
@client.set("counter", "1")
|
62
67
|
@client.incr("counter")
|
63
68
|
|
metadata
CHANGED
@@ -1,38 +1,35 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: fakeredis
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
4
5
|
prerelease:
|
5
|
-
version: 0.1.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Guillermo Iguaran
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-06-11 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: rspec
|
17
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &2164373200 !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
21
|
-
- -
|
22
|
-
- !ruby/object:Gem::Version
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
23
21
|
version: 2.0.0
|
24
22
|
type: :development
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2164373200
|
25
|
+
description: Fake implementation of redis-rb for machines without Redis or for testing
|
26
|
+
purposes
|
27
|
+
email:
|
28
28
|
- guilleiguaran@gmail.com
|
29
29
|
executables: []
|
30
|
-
|
31
30
|
extensions: []
|
32
|
-
|
33
31
|
extra_rdoc_files: []
|
34
|
-
|
35
|
-
files:
|
32
|
+
files:
|
36
33
|
- .gitignore
|
37
34
|
- .rspec
|
38
35
|
- .travis.yml
|
@@ -64,32 +61,29 @@ files:
|
|
64
61
|
- spec/transactions_spec.rb
|
65
62
|
homepage: https://github.com/guilleiguaran/fakeredis
|
66
63
|
licenses: []
|
67
|
-
|
68
64
|
post_install_message:
|
69
65
|
rdoc_options: []
|
70
|
-
|
71
|
-
require_paths:
|
66
|
+
require_paths:
|
72
67
|
- lib
|
73
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
69
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version:
|
79
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
75
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version:
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
85
80
|
requirements: []
|
86
|
-
|
87
81
|
rubyforge_project: fakeredis
|
88
82
|
rubygems_version: 1.7.2
|
89
83
|
signing_key:
|
90
84
|
specification_version: 3
|
91
85
|
summary: Fake redis-rb for your tests
|
92
|
-
test_files:
|
86
|
+
test_files:
|
93
87
|
- spec/connection_spec.rb
|
94
88
|
- spec/hashes_spec.rb
|
95
89
|
- spec/keys_spec.rb
|