mock_redis 0.15.2 → 0.15.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb02c2a8cc52839aa47201cdc27ec063f1fce875
4
- data.tar.gz: 991d301fa70caa3709990f0d95e350dfe54dddc5
3
+ metadata.gz: c9b8fbf2e49de0035f66b1a031ec57f0fcb7c345
4
+ data.tar.gz: bcfb198f89ff3d10d337ccb671a3c22ced9b2b0e
5
5
  SHA512:
6
- metadata.gz: 04b4a3f08d21973e3e0943cd4494f77b1bfd6a4c9b2fb8320034feb903995674c8acce226dd86a5f01caf2eb8af5499a6ea6c6fe7d705d9465d29026d09de7be
7
- data.tar.gz: 7651910b6293fb19d983aeac9c896b310848f51cbc5527eaeb32e7c550734b04b79125cfbb75388f587b64277087876d84006bfac40000d02a071f0a07c7d972
6
+ metadata.gz: d51552e4d5fe5da840df548d3ffaff4f3134c8674a34ca125a22a0a2682a85cdff92d2462a2f3d061e955563c8eb8a48cabafda9df5b4c6e60305f7879e9d9f1
7
+ data.tar.gz: 0e11ba27a49115af5b3fd847f87522f7a11a08d04413a23a7594877a3a5f53aed24766018ae4f6e5c6efdd83e1198390eaea1fb54f10755026759850d5c2b3ad
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # MockRedis Changelog
2
2
 
3
+ ### 0.15.3
4
+
5
+ * Fix `sadd` to return integers when adding arrays
6
+
3
7
  ### 0.15.2
4
8
 
5
9
  * Fix `zrangebyscore` to work with exclusive ranges on both ends of interval
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gemspec
7
7
  gem 'overcommit', '0.28.0'
8
8
 
9
9
  # Pin tool versions (which are executed by Overcommit) for Travis builds
10
- gem 'rubocop', '0.33.0'
10
+ gem 'rubocop', '0.34.2'
11
11
  gem 'travis', '~> 1.7'
12
12
 
13
13
  gem 'coveralls', require: false
@@ -7,22 +7,28 @@ class MockRedis
7
7
  include UtilityMethods
8
8
 
9
9
  def sadd(key, members)
10
+ members_class = members.class
10
11
  members = [members].flatten.map(&:to_s)
11
12
  assert_has_args(members, 'sadd')
12
13
 
13
14
  with_set_at(key) do |s|
15
+ size_before = s.size
14
16
  if members.size > 1
15
- size_before = s.size
16
17
  members.reverse_each { |m| s << m }
17
18
  s.size - size_before
18
19
  else
19
- !!s.add?(members.first)
20
+ added = !!s.add?(members.first)
21
+ if members_class == Array
22
+ s.size - size_before
23
+ else
24
+ added
25
+ end
20
26
  end
21
27
  end
22
28
  end
23
29
 
24
30
  def scard(key)
25
- with_set_at(key) { |s| s.length }
31
+ with_set_at(key, &:length)
26
32
  end
27
33
 
28
34
  def sdiff(*keys)
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  class MockRedis
3
- VERSION = '0.15.2'
3
+ VERSION = '0.15.3'
4
4
  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.15.2
4
+ version: 0.15.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brigade Engineering
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-27 00:00:00.000000000 Z
12
+ date: 2015-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake