mock_redis 0.15.1 → 0.15.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 876d2ece09db22d09c916764951be801e22979ba
4
- data.tar.gz: 7080cc47123cfdfff6716d8246485986186382b7
3
+ metadata.gz: cb02c2a8cc52839aa47201cdc27ec063f1fce875
4
+ data.tar.gz: 991d301fa70caa3709990f0d95e350dfe54dddc5
5
5
  SHA512:
6
- metadata.gz: 1ff7abec227e9fdbc31cbf9b5cf28c9e568003495b781c0e82f9c8ded4bd215e038996d5f134f1b13ef1478c476fa1457b00596d5246d0e2372926e497ac1c5a
7
- data.tar.gz: 8a0dd66ef2638ae20b0ffbc9fd6643a7153e094f9b6c76f499547d120225dd7caa9c668122598b43ef6ab98378079d0a2675137a42afab7702ce830c3ad1897f
6
+ metadata.gz: 04b4a3f08d21973e3e0943cd4494f77b1bfd6a4c9b2fb8320034feb903995674c8acce226dd86a5f01caf2eb8af5499a6ea6c6fe7d705d9465d29026d09de7be
7
+ data.tar.gz: 7651910b6293fb19d983aeac9c896b310848f51cbc5527eaeb32e7c550734b04b79125cfbb75388f587b64277087876d84006bfac40000d02a071f0a07c7d972
@@ -4,6 +4,9 @@ PreCommit:
4
4
  BundleCheck:
5
5
  enabled: true
6
6
 
7
+ ExecutePermissions:
8
+ enabled: true
9
+
7
10
  HardTabs:
8
11
  enabled: true
9
12
 
@@ -1,5 +1,9 @@
1
1
  # MockRedis Changelog
2
2
 
3
+ ### 0.15.2
4
+
5
+ * Fix `zrangebyscore` to work with exclusive ranges on both ends of interval
6
+
3
7
  ### 0.15.1
4
8
 
5
9
  * Fix `hmget` and `mapped_hmget` to allow passing of an array of keys
data/Gemfile CHANGED
@@ -4,10 +4,10 @@ source 'http://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  # Run all pre-commit hooks via Overcommit during CI runs
7
- gem 'overcommit', '0.27.0'
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.32.1'
10
+ gem 'rubocop', '0.33.0'
11
11
  gem 'travis', '~> 1.7'
12
12
 
13
13
  gem 'coveralls', require: false
data/Rakefile CHANGED
@@ -1,10 +1,2 @@
1
1
  require 'bundler'
2
2
  Bundler::GemHelper.install_tasks
3
-
4
- require 'rspec/core/rake_task'
5
- RSpec::Core::RakeTask.new(:spec) do |t|
6
- t.rspec_opts = %w[-fs --color]
7
- t.pattern = 'spec/**/*_spec.rb'
8
- end
9
-
10
- task :default => :spec
@@ -110,7 +110,7 @@ class MockRedis
110
110
  uri = URI(url)
111
111
 
112
112
  if uri.scheme == 'unix'
113
- defaults[:path] = uri.path
113
+ defaults[:path] = uri.path
114
114
  else
115
115
  # Require the URL to have at least a host
116
116
  raise ArgumentError, 'invalid url' unless uri.host
@@ -195,7 +195,7 @@ class MockRedis
195
195
  end
196
196
 
197
197
  char = str[char_index]
198
- char = char.chr if char.respond_to?(:chr) # ruby 1.8 vs 1.9
198
+ char = char.chr if char.respond_to?(:chr) # ruby 1.8 vs 1.9
199
199
  char_as_number = char.each_byte.reduce(0) do |a, byte|
200
200
  (a << 8) + byte
201
201
  end
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  class MockRedis
3
- VERSION = '0.15.1'
3
+ VERSION = '0.15.2'
4
4
  end
@@ -47,8 +47,8 @@ class MockRedis
47
47
  when '+inf'
48
48
  lambda { |_| false }
49
49
  when /\((.*)$/
50
- val = $1.to_f
51
- lambda { |x| x.to_f > val }
50
+ left_val = $1.to_f
51
+ lambda { |x| x.to_f > left_val }
52
52
  else
53
53
  lambda { |x| x.to_f >= min.to_f }
54
54
  end
@@ -59,8 +59,8 @@ class MockRedis
59
59
  when '+inf'
60
60
  lambda { |_| true }
61
61
  when /\((.*)$/
62
- val = $1.to_f
63
- lambda { |x| x.to_f < val }
62
+ right_val = $1.to_f
63
+ lambda { |x| x.to_f < right_val }
64
64
  else
65
65
  lambda { |x| x.to_f <= max.to_f }
66
66
  end
@@ -21,7 +21,7 @@ describe '#expireat(key, timestamp)' do
21
21
 
22
22
  it "raises an error if you don't give it a Unix timestamp" do
23
23
  lambda do
24
- @redises.expireat(@key, Time.now) # oops, forgot .to_i
24
+ @redises.expireat(@key, Time.now) # oops, forgot .to_i
25
25
  end.should raise_error(Redis::CommandError)
26
26
  end
27
27
 
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe '#getbit(key, offset)' do
4
4
  before do
5
5
  @key = 'mock-redis-test:getbit'
6
- @redises.set(@key, 'h') # ASCII 0x68
6
+ @redises.set(@key, 'h') # ASCII 0x68
7
7
  end
8
8
 
9
9
  it 'gets the bits from the key' do
@@ -22,7 +22,7 @@ describe '#hgetall(key)' do
22
22
  mr = MockRedis.new
23
23
  mr.hset(@key, 'k1', 'v1')
24
24
  mr.hset(@key, 'k2', 'v2')
25
- hash = mr.hgetall(@key)
25
+ hash = mr.hgetall(@key)
26
26
  hash['dont'] = 'mutate'
27
27
  new_hash = mr.hgetall(@key)
28
28
  new_hash.keys.sort.should == %w[k1 k2]
@@ -22,7 +22,7 @@ describe '#pexpireat(key, timestamp_ms)' do
22
22
 
23
23
  it "raises an error if you don't give it a Unix timestamp" do
24
24
  lambda do
25
- @redises.pexpireat(@key, Time.now) # oops, forgot .to_i
25
+ @redises.pexpireat(@key, Time.now) # oops, forgot .to_i
26
26
  end.should raise_error(Redis::CommandError)
27
27
  end
28
28
 
@@ -4,7 +4,7 @@ require 'spec_helper'
4
4
  describe '#setbit(key, offset)' do
5
5
  before do
6
6
  @key = 'mock-redis-test:setbit'
7
- @redises.set(@key, 'h') # ASCII 0x68
7
+ @redises.set(@key, 'h') # ASCII 0x68
8
8
  end
9
9
 
10
10
  it "returns the original stored bit's value" do
@@ -23,7 +23,7 @@ describe '#setbit(key, offset)' do
23
23
  end
24
24
 
25
25
  it 'does the right thing with multibyte characters' do
26
- @redises.set(@key, '€99.94') # the euro sign is 3 bytes wide in UTF-8
26
+ @redises.set(@key, '€99.94') # the euro sign is 3 bytes wide in UTF-8
27
27
  @redises.setbit(@key, 63, 1).should == 0
28
28
  @redises.get(@key).should == '€99.95'
29
29
  end
@@ -75,5 +75,9 @@ describe '#zrangebyscore(key, start, stop [:with_scores => true] [:limit => [off
75
75
  @redises.zrangebyscore(@key, '3', '(4').should == ['Jefferson']
76
76
  end
77
77
 
78
+ it 'honors exclusive ranges on the left and the right simultaneously' do
79
+ @redises.zrangebyscore(@key, '(1', '(4').should == %w[Adams Jefferson]
80
+ end
81
+
78
82
  it_should_behave_like 'a zset-only command'
79
83
  end
@@ -27,8 +27,8 @@ module TypeCheckingHelper
27
27
 
28
28
  def args_for_method(method)
29
29
  method_arity = @redises.real.method(method).arity
30
- if method_arity < 0 # -1 comes from def foo(*args)
31
- [1, 2] # probably good enough
30
+ if method_arity < 0 # -1 comes from def foo(*args)
31
+ [1, 2] # probably good enough
32
32
  else
33
33
  1.upto(method_arity - 1).to_a
34
34
  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.1
4
+ version: 0.15.2
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-07-22 00:00:00.000000000 Z
12
+ date: 2015-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake