mock_redis 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.overcommit.yml +20 -2
- data/CHANGELOG.md +5 -0
- data/Gemfile +8 -1
- data/README.md +3 -3
- data/lib/mock_redis/hash_methods.rb +2 -1
- data/lib/mock_redis/version.rb +1 -1
- data/mock_redis.gemspec +6 -6
- data/spec/commands/hdel_spec.rb +7 -0
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51d5bc5ef12c98487d1fc31d420608e1265eb6b7
|
4
|
+
data.tar.gz: 7fcf609fe19c71439098a4f4e588c50e588c91f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f51ea5086ba013622a7bf782607757c78d9eb9b54f146079e50d37ba7c7486446fe4face94d208395f0aa70b61d5ee4aed7240659682421e4e1461ba52b8546
|
7
|
+
data.tar.gz: c55ead056d294255f2cef773c0e8c4e9960974bda6a64887d60445b6e9211e6d7f82adfda74222294691cc659e035f4d88fea40887a3bd41f6992416f42e1085
|
data/.overcommit.yml
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
PreCommit:
|
2
|
+
BundleCheck:
|
3
|
+
enabled: true
|
4
|
+
|
5
|
+
HardTabs:
|
6
|
+
enabled: true
|
7
|
+
|
8
|
+
Rubocop:
|
9
|
+
enabled: true
|
10
|
+
command: ['bundle', 'exec', 'rubocop']
|
11
|
+
|
12
|
+
TravisLint:
|
13
|
+
enabled: true
|
14
|
+
command: ['bundle', 'exec', 'travis']
|
15
|
+
flags: ['lint', '--skip-version-check']
|
16
|
+
|
17
|
+
TrailingWhitespace:
|
18
|
+
enabled: true
|
19
|
+
|
20
|
+
YamlSyntax:
|
3
21
|
enabled: true
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
source
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in mock_redis.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
# Run all pre-commit hooks via Overcommit during CI runs
|
7
|
+
gem 'overcommit', '0.24.0'
|
8
|
+
|
9
|
+
# Pin tool versions (which are executed by Overcommit) for Travis builds
|
10
|
+
gem 'rubocop', '0.30.0'
|
11
|
+
gem 'travis', '~> 1.7'
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# MockRedis
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/mock_redis.
|
4
|
-
[![Build Status](https://travis-ci.org/
|
5
|
-
[![Dependency Status](https://gemnasium.com/
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/mock_redis.svg)](http://badge.fury.io/rb/mock_redis)
|
4
|
+
[![Build Status](https://travis-ci.org/brigade/mock_redis.svg)](https://travis-ci.org/brigade/mock_redis)
|
5
|
+
[![Dependency Status](https://gemnasium.com/brigade/mock_redis.svg)](https://gemnasium.com/brigade/mock_redis)
|
6
6
|
|
7
7
|
MockRedis provides the same interface as `redis-rb`, but it stores its
|
8
8
|
data in memory instead of talking to a Redis server. It is intended
|
@@ -10,7 +10,8 @@ class MockRedis
|
|
10
10
|
with_hash_at(key) do |hash|
|
11
11
|
if field.is_a?(Array)
|
12
12
|
orig_size = hash.size
|
13
|
-
|
13
|
+
fields = field.map(&:to_s)
|
14
|
+
hash.delete_if { |k,v| fields.include?(k) }
|
14
15
|
orig_size - hash.size
|
15
16
|
else
|
16
17
|
hash.delete(field.to_s) ? 1 : 0
|
data/lib/mock_redis/version.rb
CHANGED
data/mock_redis.gemspec
CHANGED
@@ -6,9 +6,9 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.version = MockRedis::VERSION
|
7
7
|
s.license = 'MIT'
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ['
|
10
|
-
s.email = ['eng@
|
11
|
-
s.homepage = 'https://github.com/
|
9
|
+
s.authors = ['Brigade Engineering', 'Samuel Merritt']
|
10
|
+
s.email = ['eng@brigade.com']
|
11
|
+
s.homepage = 'https://github.com/brigade/mock_redis'
|
12
12
|
s.summary = 'Redis mock that just lives in memory; useful for testing.'
|
13
13
|
|
14
14
|
s.description = <<-EOS.strip.gsub(/\s+/, ' ')
|
@@ -17,12 +17,12 @@ Gem::Specification.new do |s|
|
|
17
17
|
EOS
|
18
18
|
|
19
19
|
s.files = `git ls-files`.split("\n")
|
20
|
-
s.test_files = `git ls-files --
|
20
|
+
s.test_files = `git ls-files -- spec/*`.split("\n")
|
21
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
22
22
|
s.require_paths = ['lib']
|
23
23
|
|
24
24
|
s.add_development_dependency 'rake', '~> 10.0'
|
25
|
-
s.add_development_dependency 'redis', '~> 3.
|
26
|
-
s.add_development_dependency 'rspec', '~> 3.
|
25
|
+
s.add_development_dependency 'redis', '~> 3.2.0'
|
26
|
+
s.add_development_dependency 'rspec', '~> 3.0'
|
27
27
|
s.add_development_dependency 'rspec-its', '~> 1.0'
|
28
28
|
end
|
data/spec/commands/hdel_spec.rb
CHANGED
@@ -43,5 +43,12 @@ describe "#hdel(key, field)" do
|
|
43
43
|
@redises.get(@key).should be_nil
|
44
44
|
end
|
45
45
|
|
46
|
+
it "treats variable arguments as strings" do
|
47
|
+
field = 2
|
48
|
+
@redises.hset(@key, field, 'two')
|
49
|
+
@redises.hdel(@key, [field])
|
50
|
+
@redises.hget(@key, field).should be_nil
|
51
|
+
end
|
52
|
+
|
46
53
|
it_should_behave_like "a hash-only command"
|
47
54
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mock_redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Brigade Engineering
|
8
8
|
- Samuel Merritt
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -31,28 +31,28 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 3.
|
34
|
+
version: 3.2.0
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 3.
|
41
|
+
version: 3.2.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 3.
|
48
|
+
version: '3.0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 3.
|
55
|
+
version: '3.0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rspec-its
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,7 +70,7 @@ dependencies:
|
|
70
70
|
description: Instantiate one with `redis = MockRedis.new` and treat it like you would
|
71
71
|
a normal Redis object. It supports all the usual Redis operations.
|
72
72
|
email:
|
73
|
-
- eng@
|
73
|
+
- eng@brigade.com
|
74
74
|
executables: []
|
75
75
|
extensions: []
|
76
76
|
extra_rdoc_files: []
|
@@ -243,7 +243,7 @@ files:
|
|
243
243
|
- spec/support/shared_examples/only_operates_on_zsets.rb
|
244
244
|
- spec/support/shared_examples/sorts_enumerables.rb
|
245
245
|
- spec/transactions_spec.rb
|
246
|
-
homepage: https://github.com/
|
246
|
+
homepage: https://github.com/brigade/mock_redis
|
247
247
|
licenses:
|
248
248
|
- MIT
|
249
249
|
metadata: {}
|
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
263
263
|
version: '0'
|
264
264
|
requirements: []
|
265
265
|
rubyforge_project:
|
266
|
-
rubygems_version: 2.
|
266
|
+
rubygems_version: 2.4.5
|
267
267
|
signing_key:
|
268
268
|
specification_version: 4
|
269
269
|
summary: Redis mock that just lives in memory; useful for testing.
|