ktdreyer pushed to rubygem-redis-namespace (master). "Update to 1.5.2 (RHBZ #1207454) (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Sun Apr 5 15:36:34 UTC 2015


>From b0a7bb040978d600bd3d270f6c5ccbef0fdb7ec0 Mon Sep 17 00:00:00 2001
From: Ken Dreyer <ktdreyer at ktdreyer.com>
Date: Sun, 5 Apr 2015 09:35:56 -0600
Subject: Update to 1.5.2 (RHBZ #1207454)

- Drop Fedora 19 conditionals
- Patch for rspec 3 support
- Use %license macro

diff --git a/.gitignore b/.gitignore
index e1a63ca..577d91a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
 /redis-namespace-1.4.1.gem
 /redis-namespace-1.5.0.gem
 /redis-namespace-1.5.1.gem
+/redis-namespace-1.5.2.gem
diff --git a/rubygem-redis-namespace-1.5.2-rspec.patch b/rubygem-redis-namespace-1.5.2-rspec.patch
new file mode 100644
index 0000000..a3970ea
--- /dev/null
+++ b/rubygem-redis-namespace-1.5.2-rspec.patch
@@ -0,0 +1,879 @@
+From b9a40d270b3ca9fd0001a0a7f1b011159a341b90 Mon Sep 17 00:00:00 2001
+From: Ken Dreyer <ktdreyer at ktdreyer.com>
+Date: Sun, 5 Apr 2015 09:16:41 -0600
+Subject: [PATCH] Fedora: convert specs with transpec
+
+Support the latest rspec 3 syntax.
+
+Closes #102
+
+This is a Fedora-specific patch cherry-picked on to v1.5.2 that does not
+include the gemspec change. The full patch that was submitted upstream
+is at https://github.com/resque/redis-namespace/pull/103
+---
+ spec/deprecation_spec.rb |  39 ++++--
+ spec/redis_spec.rb       | 316 +++++++++++++++++++++++------------------------
+ 2 files changed, 189 insertions(+), 166 deletions(-)
+
+diff --git a/spec/deprecation_spec.rb b/spec/deprecation_spec.rb
+index a93ceb1..0eef9eb 100644
+--- a/spec/deprecation_spec.rb
++++ b/spec/deprecation_spec.rb
+@@ -17,17 +17,32 @@ describe Redis::Namespace do
+ 
+     subject { namespaced }
+ 
+-    its(:deprecations?) { should be false }
+-    its(:warning?) { should be true }
++    describe '#deprecations?' do
++      subject { super().deprecations? }
++      it { is_expected.to be false }
++    end
++
++    describe '#warning?' do
++      subject { super().warning? }
++      it { is_expected.to be true }
++    end
+ 
+     context('with REDIS_NAMESPACE_DEPRECATIONS') do
+       around(:each) {|e| with_env('REDIS_NAMESPACE_DEPRECATIONS'=>'1', &e) }
+-      its(:deprecations?) { should be true }
++
++      describe '#deprecations?' do
++        subject { super().deprecations? }
++        it { is_expected.to be true }
++      end
+     end
+ 
+     context('with REDIS_NAMESPACE_QUIET') do
+       around(:each) {|e| with_env('REDIS_NAMESPACE_QUIET'=>'1', &e) }
+-      its(:warning?) { should be false }
++
++      describe '#warning?' do
++        subject { super().warning? }
++        it { is_expected.to be false }
++      end
+     end
+ 
+     before(:each) do
+@@ -39,10 +54,14 @@ describe Redis::Namespace do
+     # This behaviour will hold true after the 2.x migration
+     context('with deprecations enabled') do
+       let(:options) { {:deprecations => true} }
+-      its(:deprecations?) { should be true }
++
++      describe '#deprecations?' do
++        subject { super().deprecations? }
++        it { is_expected.to be true }
++      end
+ 
+       context('with an unhandled command') do
+-        it { should_not respond_to :unhandled }
++        it { is_expected.not_to respond_to :unhandled }
+ 
+         it('raises a NoMethodError') do
+           expect do
+@@ -55,10 +74,14 @@ describe Redis::Namespace do
+     # This behaviour will no longer be available after the 2.x migration
+     context('with deprecations disabled') do
+       let(:options) { {:deprecations => false} }
+-      its(:deprecations?) { should be false }
++
++      describe '#deprecations?' do
++        subject { super().deprecations? }
++        it { is_expected.to be false }
++      end
+ 
+       context('with an an unhandled command') do
+-        it { should respond_to :unhandled }
++        it { is_expected.to respond_to :unhandled }
+ 
+         it 'blindly passes through' do
+           expect(redis).to receive(:unhandled)
+diff --git a/spec/redis_spec.rb b/spec/redis_spec.rb
+index d3f1681..7d2e61b 100644
+--- a/spec/redis_spec.rb
++++ b/spec/redis_spec.rb
+@@ -25,27 +25,27 @@ describe "redis" do
+   end
+ 
+   it "proxies `client` to the client" do
+-    @namespaced.client.should eq(@redis.client)
++    expect(@namespaced.client).to eq(@redis.client)
+   end
+ 
+   it "should be able to use a namespace" do
+-    @namespaced['foo'].should eq(nil)
++    expect(@namespaced['foo']).to eq(nil)
+     @namespaced['foo'] = 'chris'
+-    @namespaced['foo'].should eq('chris')
++    expect(@namespaced['foo']).to eq('chris')
+     @redis['foo'] = 'bob'
+-    @redis['foo'].should eq('bob')
++    expect(@redis['foo']).to eq('bob')
+ 
+     @namespaced.incrby('counter', 2)
+-    @namespaced['counter'].to_i.should eq(2)
+-    @redis['counter'].should eq(nil)
+-    @namespaced.type('counter').should eq('string')
++    expect(@namespaced['counter'].to_i).to eq(2)
++    expect(@redis['counter']).to eq(nil)
++    expect(@namespaced.type('counter')).to eq('string')
+   end
+ 
+   context 'when sending capital commands (issue 68)' do
+     it 'should be able to use a namespace' do
+       @namespaced.send('SET', 'fubar', 'quux')
+-      @redis.get('fubar').should be_nil
+-      @namespaced.get('fubar').should eq 'quux'
++      expect(@redis.get('fubar')).to be_nil
++      expect(@namespaced.get('fubar')).to eq 'quux'
+     end
+   end
+ 
+@@ -53,10 +53,10 @@ describe "redis" do
+     @namespaced.rpush "foo", "string"
+     @namespaced.rpush "foo", "ns:string"
+     @namespaced.rpush "foo", "string_no_timeout"
+-    @namespaced.blpop("foo", 1).should eq(["foo", "string"])
+-    @namespaced.blpop("foo", 1).should eq(["foo", "ns:string"])
+-    @namespaced.blpop("foo").should eq(["foo", "string_no_timeout"])
+-    @namespaced.blpop("foo", 1).should eq(nil)
++    expect(@namespaced.blpop("foo", 1)).to eq(["foo", "string"])
++    expect(@namespaced.blpop("foo", 1)).to eq(["foo", "ns:string"])
++    expect(@namespaced.blpop("foo")).to eq(["foo", "string_no_timeout"])
++    expect(@namespaced.blpop("foo", 1)).to eq(nil)
+   end
+ 
+   it "should be able to use a namespace with del" do
+@@ -64,125 +64,125 @@ describe "redis" do
+     @namespaced['bar'] = 2000
+     @namespaced['baz'] = 3000
+     @namespaced.del 'foo'
+-    @namespaced['foo'].should eq(nil)
++    expect(@namespaced['foo']).to eq(nil)
+     @namespaced.del 'bar', 'baz'
+-    @namespaced['bar'].should eq(nil)
+-    @namespaced['baz'].should eq(nil)
++    expect(@namespaced['bar']).to eq(nil)
++    expect(@namespaced['baz']).to eq(nil)
+   end
+ 
+   it 'should be able to use a namespace with append' do
+     @namespaced['foo'] = 'bar'
+-    @namespaced.append('foo','n').should eq(4)
+-    @namespaced['foo'].should eq('barn')
+-    @redis['foo'].should eq('bar')
++    expect(@namespaced.append('foo','n')).to eq(4)
++    expect(@namespaced['foo']).to eq('barn')
++    expect(@redis['foo']).to eq('bar')
+   end
+ 
+   it 'should be able to use a namespace with brpoplpush' do
+     @namespaced.lpush('foo','bar')
+-    @namespaced.brpoplpush('foo','bar',0).should eq('bar')
+-    @namespaced.lrange('foo',0,-1).should eq([])
+-    @namespaced.lrange('bar',0,-1).should eq(['bar'])
++    expect(@namespaced.brpoplpush('foo','bar',0)).to eq('bar')
++    expect(@namespaced.lrange('foo',0,-1)).to eq([])
++    expect(@namespaced.lrange('bar',0,-1)).to eq(['bar'])
+   end
+ 
+   it 'should be able to use a namespace with getbit' do
+     @namespaced.set('foo','bar')
+-    @namespaced.getbit('foo',1).should eq(1)
++    expect(@namespaced.getbit('foo',1)).to eq(1)
+   end
+ 
+   it 'should be able to use a namespace with getrange' do
+     @namespaced.set('foo','bar')
+-    @namespaced.getrange('foo',0,-1).should eq('bar')
++    expect(@namespaced.getrange('foo',0,-1)).to eq('bar')
+   end
+ 
+   it 'should be able to use a namespace with linsert' do
+     @namespaced.rpush('foo','bar')
+     @namespaced.rpush('foo','barn')
+     @namespaced.rpush('foo','bart')
+-    @namespaced.linsert('foo','BEFORE','barn','barf').should eq(4)
+-    @namespaced.lrange('foo',0,-1).should eq(['bar','barf','barn','bart'])
++    expect(@namespaced.linsert('foo','BEFORE','barn','barf')).to eq(4)
++    expect(@namespaced.lrange('foo',0,-1)).to eq(['bar','barf','barn','bart'])
+   end
+ 
+   it 'should be able to use a namespace with lpushx' do
+-    @namespaced.lpushx('foo','bar').should eq(0)
++    expect(@namespaced.lpushx('foo','bar')).to eq(0)
+     @namespaced.lpush('foo','boo')
+-    @namespaced.lpushx('foo','bar').should eq(2)
+-    @namespaced.lrange('foo',0,-1).should eq(['bar','boo'])
++    expect(@namespaced.lpushx('foo','bar')).to eq(2)
++    expect(@namespaced.lrange('foo',0,-1)).to eq(['bar','boo'])
+   end
+ 
+   it 'should be able to use a namespace with rpushx' do
+-    @namespaced.rpushx('foo','bar').should eq(0)
++    expect(@namespaced.rpushx('foo','bar')).to eq(0)
+     @namespaced.lpush('foo','boo')
+-    @namespaced.rpushx('foo','bar').should eq(2)
+-    @namespaced.lrange('foo',0,-1).should eq(['boo','bar'])
++    expect(@namespaced.rpushx('foo','bar')).to eq(2)
++    expect(@namespaced.lrange('foo',0,-1)).to eq(['boo','bar'])
+   end
+ 
+   it 'should be able to use a namespace with setbit' do
+     @namespaced.setbit('virgin_key', 1, 1)
+-    @namespaced.exists('virgin_key').should be_true
+-    @namespaced.get('virgin_key').should eq(@namespaced.getrange('virgin_key',0,-1))
++    expect(@namespaced.exists('virgin_key')).to be_truthy
++    expect(@namespaced.get('virgin_key')).to eq(@namespaced.getrange('virgin_key',0,-1))
+   end
+ 
+   it 'should be able to use a namespace with setrange' do
+     @namespaced.setrange('foo', 0, 'bar')
+-    @namespaced['foo'].should eq('bar')
++    expect(@namespaced['foo']).to eq('bar')
+ 
+     @namespaced.setrange('bar', 2, 'foo')
+-    @namespaced['bar'].should eq("\000\000foo")
++    expect(@namespaced['bar']).to eq("\000\000foo")
+   end
+ 
+   it "should be able to use a namespace with mget" do
+     @namespaced['foo'] = 1000
+     @namespaced['bar'] = 2000
+-    @namespaced.mapped_mget('foo', 'bar').should eq({ 'foo' => '1000', 'bar' => '2000' })
+-    @namespaced.mapped_mget('foo', 'baz', 'bar').should eq({'foo'=>'1000', 'bar'=>'2000', 'baz' => nil})
++    expect(@namespaced.mapped_mget('foo', 'bar')).to eq({ 'foo' => '1000', 'bar' => '2000' })
++    expect(@namespaced.mapped_mget('foo', 'baz', 'bar')).to eq({'foo'=>'1000', 'bar'=>'2000', 'baz' => nil})
+   end
+ 
+   it "should be able to use a namespace with mset" do
+     @namespaced.mset('foo', '1000', 'bar', '2000')
+-    @namespaced.mapped_mget('foo', 'bar').should eq({ 'foo' => '1000', 'bar' => '2000' })
+-    @namespaced.mapped_mget('foo', 'baz', 'bar').should eq({ 'foo' => '1000', 'bar' => '2000', 'baz' => nil})
++    expect(@namespaced.mapped_mget('foo', 'bar')).to eq({ 'foo' => '1000', 'bar' => '2000' })
++    expect(@namespaced.mapped_mget('foo', 'baz', 'bar')).to eq({ 'foo' => '1000', 'bar' => '2000', 'baz' => nil})
+     @namespaced.mapped_mset('foo' => '3000', 'bar' => '5000')
+-    @namespaced.mapped_mget('foo', 'bar').should eq({ 'foo' => '3000', 'bar' => '5000' })
+-    @namespaced.mapped_mget('foo', 'baz', 'bar').should eq({ 'foo' => '3000', 'bar' => '5000', 'baz' => nil})
++    expect(@namespaced.mapped_mget('foo', 'bar')).to eq({ 'foo' => '3000', 'bar' => '5000' })
++    expect(@namespaced.mapped_mget('foo', 'baz', 'bar')).to eq({ 'foo' => '3000', 'bar' => '5000', 'baz' => nil})
+   end
+ 
+   it "should be able to use a namespace with msetnx" do
+     @namespaced.msetnx('foo', '1000', 'bar', '2000')
+-    @namespaced.mapped_mget('foo', 'bar').should eq({ 'foo' => '1000', 'bar' => '2000' })
+-    @namespaced.mapped_mget('foo', 'baz', 'bar').should eq({ 'foo' => '1000', 'bar' => '2000', 'baz' => nil})
++    expect(@namespaced.mapped_mget('foo', 'bar')).to eq({ 'foo' => '1000', 'bar' => '2000' })
++    expect(@namespaced.mapped_mget('foo', 'baz', 'bar')).to eq({ 'foo' => '1000', 'bar' => '2000', 'baz' => nil})
+   end
+ 
+   it "should be able to use a namespace with mapped_msetnx" do
+     @namespaced.set('foo','1')
+-    @namespaced.mapped_msetnx('foo'=>'1000', 'bar'=>'2000').should be_false
+-    @namespaced.mapped_mget('foo', 'bar').should eq({ 'foo' => '1', 'bar' => nil })
+-    @namespaced.mapped_msetnx('bar'=>'2000', 'baz'=>'1000').should be_true
+-    @namespaced.mapped_mget('foo', 'bar').should eq({ 'foo' => '1', 'bar' => '2000' })
++    expect(@namespaced.mapped_msetnx('foo'=>'1000', 'bar'=>'2000')).to be_falsey
++    expect(@namespaced.mapped_mget('foo', 'bar')).to eq({ 'foo' => '1', 'bar' => nil })
++    expect(@namespaced.mapped_msetnx('bar'=>'2000', 'baz'=>'1000')).to be_truthy
++    expect(@namespaced.mapped_mget('foo', 'bar')).to eq({ 'foo' => '1', 'bar' => '2000' })
+   end
+ 
+   it "should be able to use a namespace with hashes" do
+     @namespaced.hset('foo', 'key', 'value')
+     @namespaced.hset('foo', 'key1', 'value1')
+-    @namespaced.hget('foo', 'key').should eq('value')
+-    @namespaced.hgetall('foo').should eq({'key' => 'value', 'key1' => 'value1'})
+-    @namespaced.hlen('foo').should eq(2)
+-    @namespaced.hkeys('foo').should eq(['key', 'key1'])
++    expect(@namespaced.hget('foo', 'key')).to eq('value')
++    expect(@namespaced.hgetall('foo')).to eq({'key' => 'value', 'key1' => 'value1'})
++    expect(@namespaced.hlen('foo')).to eq(2)
++    expect(@namespaced.hkeys('foo')).to eq(['key', 'key1'])
+     @namespaced.hmset('bar', 'key', 'value', 'key1', 'value1')
+     @namespaced.hmget('bar', 'key', 'key1')
+     @namespaced.hmset('bar', 'a_number', 1)
+-    @namespaced.hmget('bar', 'a_number').should eq(['1'])
++    expect(@namespaced.hmget('bar', 'a_number')).to eq(['1'])
+     @namespaced.hincrby('bar', 'a_number', 3)
+-    @namespaced.hmget('bar', 'a_number').should eq(['4'])
+-    @namespaced.hgetall('bar').should eq({'key' => 'value', 'key1' => 'value1', 'a_number' => '4'})
+-
+-    @namespaced.hsetnx('foonx','nx',10).should be_true
+-    @namespaced.hsetnx('foonx','nx',12).should be_false
+-    @namespaced.hget('foonx','nx').should eq("10")
+-    @namespaced.hkeys('foonx').should eq(%w{ nx })
+-    @namespaced.hvals('foonx').should eq(%w{ 10 })
++    expect(@namespaced.hmget('bar', 'a_number')).to eq(['4'])
++    expect(@namespaced.hgetall('bar')).to eq({'key' => 'value', 'key1' => 'value1', 'a_number' => '4'})
++
++    expect(@namespaced.hsetnx('foonx','nx',10)).to be_truthy
++    expect(@namespaced.hsetnx('foonx','nx',12)).to be_falsey
++    expect(@namespaced.hget('foonx','nx')).to eq("10")
++    expect(@namespaced.hkeys('foonx')).to eq(%w{ nx })
++    expect(@namespaced.hvals('foonx')).to eq(%w{ 10 })
+     @namespaced.mapped_hmset('baz', {'key' => 'value', 'key1' => 'value1', 'a_number' => 4})
+-    @namespaced.mapped_hmget('baz', 'key', 'key1', 'a_number').should eq({'key' => 'value', 'key1' => 'value1', 'a_number' => '4'})
+-    @namespaced.hgetall('baz').should eq({'key' => 'value', 'key1' => 'value1', 'a_number' => '4'})
++    expect(@namespaced.mapped_hmget('baz', 'key', 'key1', 'a_number')).to eq({'key' => 'value', 'key1' => 'value1', 'a_number' => '4'})
++    expect(@namespaced.hgetall('baz')).to eq({'key' => 'value', 'key1' => 'value1', 'a_number' => '4'})
+   end
+ 
+   it "should properly intersect three sets" do
+@@ -193,7 +193,7 @@ describe "redis" do
+     @namespaced.sadd('bar', 3)
+     @namespaced.sadd('bar', 4)
+     @namespaced.sadd('baz', 3)
+-    @namespaced.sinter('foo', 'bar', 'baz').should eq(%w( 3 ))
++    expect(@namespaced.sinter('foo', 'bar', 'baz')).to eq(%w( 3 ))
+   end
+ 
+   it "should properly union two sets" do
+@@ -202,7 +202,7 @@ describe "redis" do
+     @namespaced.sadd('bar', 2)
+     @namespaced.sadd('bar', 3)
+     @namespaced.sadd('bar', 4)
+-    @namespaced.sunion('foo', 'bar').sort.should eq(%w( 1 2 3 4 ))
++    expect(@namespaced.sunion('foo', 'bar').sort).to eq(%w( 1 2 3 4 ))
+   end
+ 
+   it "should properly union two sorted sets with options" do
+@@ -212,7 +212,7 @@ describe "redis" do
+     @namespaced.zadd('sort2', 3, 3)
+     @namespaced.zadd('sort2', 4, 4)
+     @namespaced.zunionstore('union', ['sort1', 'sort2'], :weights => [2, 1])
+-    @namespaced.zrevrange('union', 0, -1).should eq(%w( 2 4 3 1 ))
++    expect(@namespaced.zrevrange('union', 0, -1)).to eq(%w( 2 4 3 1 ))
+   end
+ 
+   it "should properly union two sorted sets without options" do
+@@ -222,7 +222,7 @@ describe "redis" do
+     @namespaced.zadd('sort2', 3, 3)
+     @namespaced.zadd('sort2', 4, 4)
+     @namespaced.zunionstore('union', ['sort1', 'sort2'])
+-    @namespaced.zrevrange('union', 0, -1).should eq(%w( 4 2 3 1 ))
++    expect(@namespaced.zrevrange('union', 0, -1)).to eq(%w( 4 2 3 1 ))
+   end
+ 
+   it "should properly intersect two sorted sets without options" do
+@@ -237,7 +237,7 @@ describe "redis" do
+     @namespaced.zinterstore('inter', ['food', 'color'])
+ 
+     inter_values = @namespaced.zrevrange('inter', 0, -1, :with_scores => true)
+-    inter_values.should =~ [['orange', 3.0], ['eggplant', 7.0]]
++    expect(inter_values).to match_array([['orange', 3.0], ['eggplant', 7.0]])
+   end
+ 
+   it "should properly intersect two sorted sets with options" do
+@@ -252,7 +252,7 @@ describe "redis" do
+     @namespaced.zinterstore('inter', ['food', 'color'], :aggregate => "min")
+ 
+     inter_values = @namespaced.zrevrange('inter', 0, -1, :with_scores => true)
+-    inter_values.should =~ [['orange', 1.0], ['eggplant', 3.0]]
++    expect(inter_values).to match_array([['orange', 1.0], ['eggplant', 3.0]])
+   end
+ 
+   it "should add namespace to sort" do
+@@ -263,24 +263,24 @@ describe "redis" do
+     @namespaced.set('value_1', 'a')
+     @namespaced.set('value_2', 'b')
+ 
+-    @namespaced.sort('foo').should eq(%w( 1 2 ))
+-    @namespaced.sort('foo', :limit => [0, 1]).should eq(%w( 1 ))
+-    @namespaced.sort('foo', :order => 'desc').should eq(%w( 2 1 ))
+-    @namespaced.sort('foo', :by => 'weight_*').should eq(%w( 2 1 ))
+-    @namespaced.sort('foo', :get => 'value_*').should eq(%w( a b ))
+-    @namespaced.sort('foo', :get => '#').should eq(%w( 1 2 ))
+-    @namespaced.sort('foo', :get => ['#', 'value_*']).should eq([["1", "a"], ["2", "b"]])
++    expect(@namespaced.sort('foo')).to eq(%w( 1 2 ))
++    expect(@namespaced.sort('foo', :limit => [0, 1])).to eq(%w( 1 ))
++    expect(@namespaced.sort('foo', :order => 'desc')).to eq(%w( 2 1 ))
++    expect(@namespaced.sort('foo', :by => 'weight_*')).to eq(%w( 2 1 ))
++    expect(@namespaced.sort('foo', :get => 'value_*')).to eq(%w( a b ))
++    expect(@namespaced.sort('foo', :get => '#')).to eq(%w( 1 2 ))
++    expect(@namespaced.sort('foo', :get => ['#', 'value_*'])).to eq([["1", "a"], ["2", "b"]])
+ 
+     @namespaced.sort('foo', :store => 'result')
+-    @namespaced.lrange('result', 0, -1).should eq(%w( 1 2 ))
++    expect(@namespaced.lrange('result', 0, -1)).to eq(%w( 1 2 ))
+   end
+ 
+   it "should yield the correct list of keys" do
+     @namespaced["foo"] = 1
+     @namespaced["bar"] = 2
+     @namespaced["baz"] = 3
+-    @namespaced.keys("*").sort.should eq(%w( bar baz foo ))
+-    @namespaced.keys.sort.should eq(%w( bar baz foo ))
++    expect(@namespaced.keys("*").sort).to eq(%w( bar baz foo ))
++    expect(@namespaced.keys.sort).to eq(%w( bar baz foo ))
+   end
+ 
+   it "should add namepsace to multi blocks" do
+@@ -289,7 +289,7 @@ describe "redis" do
+       r.del "foo"
+       r.mapped_hmset "foo", {"key1" => "value1"}
+     end
+-    @namespaced.hgetall("foo").should eq({"key1" => "value1"})
++    expect(@namespaced.hgetall("foo")).to eq({"key1" => "value1"})
+   end
+ 
+   it "should pass through multi commands without block" do
+@@ -300,14 +300,14 @@ describe "redis" do
+     @namespaced.mapped_hmset "foo", {"key1" => "value1"}
+     @namespaced.exec
+ 
+-    @namespaced.hgetall("foo").should eq({"key1" => "value1"})
++    expect(@namespaced.hgetall("foo")).to eq({"key1" => "value1"})
+   end
+ 
+   it 'should return futures without attempting to remove namespaces' do
+     @namespaced.multi do
+       @future = @namespaced.keys('*')
+     end
+-    @future.class.should be(Redis::Future)
++    expect(@future.class).to be(Redis::Future)
+   end
+ 
+   it "should add namespace to pipelined blocks" do
+@@ -316,7 +316,7 @@ describe "redis" do
+       r.del "foo"
+       r.mapped_hmset "foo", {"key1" => "value1"}
+     end
+-    @namespaced.hgetall("foo").should eq({"key1" => "value1"})
++    expect(@namespaced.hgetall("foo")).to eq({"key1" => "value1"})
+   end
+ 
+   it "should returned response array from pipelined block" do
+@@ -325,59 +325,59 @@ describe "redis" do
+       r["foo"]
+       r["key"]
+     end
+-    result.should eq(["bar", "value"])
++    expect(result).to eq(["bar", "value"])
+   end
+ 
+   it "should add namespace to strlen" do
+     @namespaced.set("mykey", "123456")
+-    @namespaced.strlen("mykey").should eq(6)
++    expect(@namespaced.strlen("mykey")).to eq(6)
+   end
+ 
+   it "should not add namespace to echo" do
+-    @namespaced.echo(123).should eq("123")
++    expect(@namespaced.echo(123)).to eq("123")
+   end
+ 
+   it 'should not add namespace to disconnect!' do
+-    expect(@redis).to receive(:disconnect!).with().and_call_original
++    expect(@redis).to receive(:disconnect!).with(no_args).and_call_original
+ 
+     expect(@namespaced.disconnect!).to be nil
+   end
+ 
+   it "can change its namespace" do
+-    @namespaced['foo'].should eq(nil)
++    expect(@namespaced['foo']).to eq(nil)
+     @namespaced['foo'] = 'chris'
+-    @namespaced['foo'].should eq('chris')
++    expect(@namespaced['foo']).to eq('chris')
+ 
+-    @namespaced.namespace.should eq(:ns)
++    expect(@namespaced.namespace).to eq(:ns)
+     @namespaced.namespace = :spec
+-    @namespaced.namespace.should eq(:spec)
++    expect(@namespaced.namespace).to eq(:spec)
+ 
+-    @namespaced['foo'].should eq(nil)
++    expect(@namespaced['foo']).to eq(nil)
+     @namespaced['foo'] = 'chris'
+-    @namespaced['foo'].should eq('chris')
++    expect(@namespaced['foo']).to eq('chris')
+   end
+ 
+   it "can accept a temporary namespace" do
+-    @namespaced.namespace.should eq(:ns)
+-    @namespaced['foo'].should eq(nil)
++    expect(@namespaced.namespace).to eq(:ns)
++    expect(@namespaced['foo']).to eq(nil)
+ 
+     @namespaced.namespace(:spec) do |temp_ns|
+-      temp_ns.namespace.should eq(:spec)
+-      temp_ns['foo'].should eq(nil)
++      expect(temp_ns.namespace).to eq(:spec)
++      expect(temp_ns['foo']).to eq(nil)
+       temp_ns['foo'] = 'jake'
+-      temp_ns['foo'].should eq('jake')
++      expect(temp_ns['foo']).to eq('jake')
+     end
+ 
+-    @namespaced.namespace.should eq(:ns)
+-    @namespaced['foo'].should eq(nil)
++    expect(@namespaced.namespace).to eq(:ns)
++    expect(@namespaced['foo']).to eq(nil)
+   end
+ 
+   it "should respond to :namespace=" do
+-    @namespaced.respond_to?(:namespace=).should eq(true)
++    expect(@namespaced.respond_to?(:namespace=)).to be_truthy
+   end
+ 
+   it "should respond to :warning=" do
+-    @namespaced.respond_to?(:warning=).should == true
++    expect(@namespaced.respond_to?(:warning=)).to be_truthy
+   end
+ 
+   it "should raise an exception when an unknown command is passed" do
+@@ -417,7 +417,7 @@ describe "redis" do
+         v = @namespaced.dump("foo")
+         @redis.del("ns:foo")
+ 
+-        expect(@namespaced.restore("foo", 1000, v)).to be_true
++        expect(@namespaced.restore("foo", 1000, v)).to be_truthy
+         expect(@redis.get("ns:foo")).to eq 'a'
+         expect(@redis.ttl("ns:foo")).to satisfy {|v| (0..1).include?(v) }
+ 
+@@ -425,64 +425,64 @@ describe "redis" do
+         w = @namespaced.dump("bar")
+         @redis.del("ns:bar")
+ 
+-        expect(@namespaced.restore("bar", 1000, w)).to be_true
++        expect(@namespaced.restore("bar", 1000, w)).to be_truthy
+         expect(@redis.lrange('ns:bar', 0, -1)).to eq %w(b c d)
+         expect(@redis.ttl("ns:foo")).to satisfy {|v| (0..1).include?(v) }
+       end
+ 
+       it "should namespace hincrbyfloat" do
+         @namespaced.hset('mykey', 'field', 10.50)
+-        @namespaced.hincrbyfloat('mykey', 'field', 0.1).should eq(10.6)
++        expect(@namespaced.hincrbyfloat('mykey', 'field', 0.1)).to eq(10.6)
+       end
+ 
+       it "should namespace incrbyfloat" do
+         @namespaced.set('mykey', 10.50)
+-        @namespaced.incrbyfloat('mykey', 0.1).should eq(10.6)
++        expect(@namespaced.incrbyfloat('mykey', 0.1)).to eq(10.6)
+       end
+ 
+       it "should namespace object" do
+         @namespaced.set('foo', 1000)
+-        @namespaced.object('encoding', 'foo').should eq('int')
++        expect(@namespaced.object('encoding', 'foo')).to eq('int')
+       end
+ 
+       it "should namespace persist" do
+         @namespaced.set('mykey', 'Hello')
+         @namespaced.expire('mykey', 60)
+-        @namespaced.persist('mykey').should eq(true)
+-        @namespaced.ttl('mykey').should eq(-1)
++        expect(@namespaced.persist('mykey')).to be_truthy
++        expect(@namespaced.ttl('mykey')).to eq(-1)
+       end
+ 
+       it "should namespace pexpire" do
+         @namespaced.set('mykey', 'Hello')
+-        @namespaced.pexpire('mykey', 60000).should eq(true)
++        expect(@namespaced.pexpire('mykey', 60000)).to be_truthy
+       end
+ 
+       it "should namespace pexpireat" do
+         @namespaced.set('mykey', 'Hello')
+-        @namespaced.pexpire('mykey', 1555555555005).should eq(true)
++        expect(@namespaced.pexpire('mykey', 1555555555005)).to be_truthy
+       end
+ 
+       it "should namespace psetex" do
+-        @namespaced.psetex('mykey', 10000, 'Hello').should eq('OK')
+-        @namespaced.get('mykey').should eq('Hello')
++        expect(@namespaced.psetex('mykey', 10000, 'Hello')).to eq('OK')
++        expect(@namespaced.get('mykey')).to eq('Hello')
+       end
+ 
+       it "should namespace pttl" do
+         @namespaced.set('mykey', 'Hello')
+         @namespaced.expire('mykey', 1)
+-        @namespaced.pttl('mykey').should >= 0
++        expect(@namespaced.pttl('mykey')).to be >= 0
+       end
+ 
+       it "should namespace eval keys passed in as array args" do
+-        @namespaced.
+-          eval("return {KEYS[1], KEYS[2]}", %w[k1 k2], %w[arg1 arg2]).
+-          should eq(%w[ns:k1 ns:k2])
++        expect(@namespaced.
++          eval("return {KEYS[1], KEYS[2]}", %w[k1 k2], %w[arg1 arg2])).
++          to eq(%w[ns:k1 ns:k2])
+       end
+ 
+       it "should namespace eval keys passed in as hash args" do
+-        @namespaced.
+-          eval("return {KEYS[1], KEYS[2]}", :keys => %w[k1 k2], :argv => %w[arg1 arg2]).
+-          should eq(%w[ns:k1 ns:k2])
++        expect(@namespaced.
++          eval("return {KEYS[1], KEYS[2]}", :keys => %w[k1 k2], :argv => %w[arg1 arg2])).
++          to eq(%w[ns:k1 ns:k2])
+       end
+ 
+       context '#evalsha' do
+@@ -491,15 +491,15 @@ describe "redis" do
+         end
+ 
+         it "should namespace evalsha keys passed in as array args" do
+-          @namespaced.
+-            evalsha(sha, %w[k1 k2], %w[arg1 arg2]).
+-            should eq(%w[ns:k1 ns:k2])
++          expect(@namespaced.
++            evalsha(sha, %w[k1 k2], %w[arg1 arg2])).
++            to eq(%w[ns:k1 ns:k2])
+         end
+ 
+         it "should namespace evalsha keys passed in as hash args" do
+-          @namespaced.
+-            evalsha(sha, :keys => %w[k1 k2], :argv => %w[arg1 arg2]).
+-            should eq(%w[ns:k1 ns:k2])
++          expect(@namespaced.
++            evalsha(sha, :keys => %w[k1 k2], :argv => %w[arg1 arg2])).
++            to eq(%w[ns:k1 ns:k2])
+         end
+       end
+ 
+@@ -508,13 +508,13 @@ describe "redis" do
+         let(:sha) { nested_namespace.script(:load, "return {KEYS[1], KEYS[2]}") }
+ 
+         it "should namespace eval keys passed in as hash args" do
+-          nested_namespace.
+-          eval("return {KEYS[1], KEYS[2]}", :keys => %w[k1 k2], :argv => %w[arg1 arg2]).
+-          should eq(%w[ns:nest:k1 ns:nest:k2])
++          expect(nested_namespace.
++          eval("return {KEYS[1], KEYS[2]}", :keys => %w[k1 k2], :argv => %w[arg1 arg2])).
++          to eq(%w[ns:nest:k1 ns:nest:k2])
+         end
+         it "should namespace evalsha keys passed in as hash args" do
+-          nested_namespace.evalsha(sha, :keys => %w[k1 k2], :argv => %w[arg1 arg2]).
+-            should eq(%w[ns:nest:k1 ns:nest:k2])
++          expect(nested_namespace.evalsha(sha, :keys => %w[k1 k2], :argv => %w[arg1 arg2])).
++            to eq(%w[ns:nest:k1 ns:nest:k2])
+         end
+       end
+     end
+@@ -543,13 +543,13 @@ describe "redis" do
+           context 'when :match supplied' do
+             it 'should retrieve the proper keys' do
+               _, result = @namespaced.scan(0, :match => 'zeta:*', :count => 1000)
+-              result.should =~ matching_namespaced_keys
++              expect(result).to match_array(matching_namespaced_keys)
+             end
+           end
+           context 'without :match supplied' do
+             it 'should retrieve the proper keys' do
+               _, result = @namespaced.scan(0, :count => 1000)
+-              result.should =~ namespaced_keys
++              expect(result).to match_array(namespaced_keys)
+             end
+           end
+         end if Redis.current.respond_to?(:scan)
+@@ -560,13 +560,13 @@ describe "redis" do
+               it 'should yield unnamespaced' do
+                 results = []
+                 @namespaced.scan_each(:match => 'zeta:*', :count => 1000) {|k| results << k }
+-                results.should =~ matching_namespaced_keys
++                expect(results).to match_array(matching_namespaced_keys)
+               end
+             end
+             context 'without a block' do
+               it 'should return an Enumerator that un-namespaces' do
+                 enum = @namespaced.scan_each(:match => 'zeta:*', :count => 1000)
+-                enum.to_a.should =~ matching_namespaced_keys
++                expect(enum.to_a).to match_array(matching_namespaced_keys)
+               end
+             end
+           end
+@@ -575,13 +575,13 @@ describe "redis" do
+               it 'should yield unnamespaced' do
+                 results = []
+                 @namespaced.scan_each(:count => 1000){ |k| results << k }
+-                results.should =~ namespaced_keys
++                expect(results).to match_array(namespaced_keys)
+               end
+             end
+             context 'without a block' do
+               it 'should return an Enumerator that un-namespaces' do
+                 enum = @namespaced.scan_each(:count => 1000)
+-                enum.to_a.should =~ namespaced_keys
++                expect(enum.to_a).to match_array(namespaced_keys)
+               end
+             end
+           end
+@@ -604,13 +604,13 @@ describe "redis" do
+           context 'when supplied :match' do
+             it 'should retrieve the proper keys' do
+               _, results = @namespaced.hscan('hsh', 0, :match => 'zeta:*')
+-              results.should =~ hash_matching_subset.to_a
++              expect(results).to match_array(hash_matching_subset.to_a)
+             end
+           end
+           context 'without :match supplied' do
+             it 'should retrieve all hash keys' do
+               _, results = @namespaced.hscan('hsh', 0)
+-              results.should =~ @redis.hgetall('ns:hsh').to_a
++              expect(results).to match_array(@redis.hgetall('ns:hsh').to_a)
+             end
+           end
+         end if Redis.current.respond_to?(:hscan)
+@@ -621,13 +621,13 @@ describe "redis" do
+               it 'should yield the correct hash keys unchanged' do
+                 results = []
+                 @namespaced.hscan_each('hsh', :match => 'zeta:*', :count => 1000) { |kv| results << kv}
+-                results.should =~ hash_matching_subset.to_a
++                expect(results).to match_array(hash_matching_subset.to_a)
+               end
+             end
+             context 'without a block' do
+               it 'should return an Enumerator that yields the correct hash keys unchanged' do
+                 enum = @namespaced.hscan_each('hsh', :match => 'zeta:*', :count => 1000)
+-                enum.to_a.should =~ hash_matching_subset.to_a
++                expect(enum.to_a).to match_array(hash_matching_subset.to_a)
+               end
+             end
+           end
+@@ -636,13 +636,13 @@ describe "redis" do
+               it 'should yield all hash keys unchanged' do
+                 results = []
+                 @namespaced.hscan_each('hsh', :count => 1000){ |k| results << k }
+-                results.should =~ hash.to_a
++                expect(results).to match_array(hash.to_a)
+               end
+             end
+             context 'without a block' do
+               it 'should return an Enumerator that yields all keys unchanged' do
+                 enum = @namespaced.hscan_each('hsh', :count => 1000)
+-                enum.to_a.should =~ hash.to_a
++                expect(enum.to_a).to match_array(hash.to_a)
+               end
+             end
+           end
+@@ -665,13 +665,13 @@ describe "redis" do
+           context 'when supplied :match' do
+             it 'should retrieve the matching set members from the proper set' do
+               _, results = @namespaced.sscan('set', 0, :match => 'zeta:*', :count => 1000)
+-              results.should =~ matching_subset
++              expect(results).to match_array(matching_subset)
+             end
+           end
+           context 'without :match supplied' do
+             it 'should retrieve all set members from the proper set' do
+               _, results = @namespaced.sscan('set', 0, :count => 1000)
+-              results.should =~ set
++              expect(results).to match_array(set)
+             end
+           end
+         end if Redis.current.respond_to?(:sscan)
+@@ -682,13 +682,13 @@ describe "redis" do
+               it 'should yield the correct hset elements unchanged' do
+                 results = []
+                 @namespaced.sscan_each('set', :match => 'zeta:*', :count => 1000) { |kv| results << kv}
+-                results.should =~ matching_subset
++                expect(results).to match_array(matching_subset)
+               end
+             end
+             context 'without a block' do
+               it 'should return an Enumerator that yields the correct set elements unchanged' do
+                 enum = @namespaced.sscan_each('set', :match => 'zeta:*', :count => 1000)
+-                enum.to_a.should =~ matching_subset
++                expect(enum.to_a).to match_array(matching_subset)
+               end
+             end
+           end
+@@ -697,13 +697,13 @@ describe "redis" do
+               it 'should yield all set elements unchanged' do
+                 results = []
+                 @namespaced.sscan_each('set', :count => 1000){ |k| results << k }
+-                results.should =~ set
++                expect(results).to match_array(set)
+               end
+             end
+             context 'without a block' do
+               it 'should return an Enumerator that yields all set elements unchanged' do
+                 enum = @namespaced.sscan_each('set', :count => 1000)
+-                enum.to_a.should =~ set
++                expect(enum.to_a).to match_array(set)
+               end
+             end
+           end
+@@ -727,14 +727,14 @@ describe "redis" do
+             it 'should retrieve the matching set elements and their scores' do
+               results = []
+               @namespaced.zscan_each('zset', :match => 'zeta:*', :count => 1000) { |ms| results << ms }
+-              results.should =~ hash_matching_subset.to_a
++              expect(results).to match_array(hash_matching_subset.to_a)
+             end
+           end
+           context 'without :match supplied' do
+             it 'should retrieve all set elements and their scores' do
+               results = []
+               @namespaced.zscan_each('zset', :count => 1000) { |ms| results << ms }
+-              results.should =~ hash.to_a
++              expect(results).to match_array(hash.to_a)
+             end
+           end
+         end if Redis.current.respond_to?(:zscan)
+@@ -745,13 +745,13 @@ describe "redis" do
+               it 'should yield the correct set elements and scores unchanged' do
+                 results = []
+                 @namespaced.zscan_each('zset', :match => 'zeta:*', :count => 1000) { |ms| results << ms}
+-                results.should =~ hash_matching_subset.to_a
++                expect(results).to match_array(hash_matching_subset.to_a)
+               end
+             end
+             context 'without a block' do
+               it 'should return an Enumerator that yields the correct set elements and scoresunchanged' do
+                 enum = @namespaced.zscan_each('zset', :match => 'zeta:*', :count => 1000)
+-                enum.to_a.should =~ hash_matching_subset.to_a
++                expect(enum.to_a).to match_array(hash_matching_subset.to_a)
+               end
+             end
+           end
+@@ -760,13 +760,13 @@ describe "redis" do
+               it 'should yield all set elements and scores unchanged' do
+                 results = []
+                 @namespaced.zscan_each('zset', :count => 1000){ |ms| results << ms }
+-                results.should =~ hash.to_a
++                expect(results).to match_array(hash.to_a)
+               end
+             end
+             context 'without a block' do
+               it 'should return an Enumerator that yields all set elements and scores unchanged' do
+                 enum = @namespaced.zscan_each('zset', :count => 1000)
+-                enum.to_a.should =~ hash.to_a
++                expect(enum.to_a).to match_array(hash.to_a)
+               end
+             end
+           end
+@@ -778,12 +778,12 @@ describe "redis" do
+   if @redis_version >= Gem::Version.new("2.8.9")
+     it 'should namespace pfadd' do
+       5.times { |n| @namespaced.pfadd("pf", n) }
+-      @redis.pfcount("ns:pf").should == 5
++      expect(@redis.pfcount("ns:pf")).to eq(5)
+     end
+ 
+     it 'should namespace pfcount' do
+       5.times { |n| @redis.pfadd("ns:pf", n) }
+-      @namespaced.pfcount("pf").should == 5
++      expect(@namespaced.pfcount("pf")).to eq(5)
+     end
+ 
+     it 'should namespace pfmerge' do
+@@ -793,7 +793,7 @@ describe "redis" do
+       end
+ 
+       @namespaced.pfmerge("pfc", "pfa", "pfb")
+-      @redis.pfcount("ns:pfc").should == 10
++      expect(@redis.pfcount("ns:pfc")).to eq(10)
+     end
+   end
+ end
+-- 
+1.9.3
+
diff --git a/rubygem-redis-namespace.spec b/rubygem-redis-namespace.spec
index 9e8b959..a3be95a 100644
--- a/rubygem-redis-namespace.spec
+++ b/rubygem-redis-namespace.spec
@@ -1,7 +1,7 @@
 %global gem_name redis-namespace
 
 Name: rubygem-%{gem_name}
-Version: 1.5.1
+Version: 1.5.2
 Release: 1%{?dist}
 Summary: Namespaces Redis commands
 Group: Development/Languages
@@ -9,7 +9,10 @@ License: MIT
 URL: https://github.com/resque/redis-namespace
 Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
 Source1: rubygem-redis-namespace-test.conf
-%if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
+# Rspec 3 support
+# https://github.com/resque/redis-namespace/pull/103
+Patch0: rubygem-redis-namespace-1.5.2-rspec.patch
+%if 0%{?fc20} || 0%{?el7}
 Requires: ruby(release)
 Requires: ruby(rubygems)
 Requires: rubygem(redis) => 3
@@ -17,12 +20,12 @@ Requires: rubygem(redis) < 4
 %endif
 BuildRequires: ruby(release)
 BuildRequires: rubygems-devel
-BuildRequires: rubygem(rspec)
+BuildRequires: rubygem(rspec) => 3
 BuildRequires: rubygem(redis) => 3
 BuildRequires: rubygem(redis) < 4
 BuildRequires: redis
 BuildArch: noarch
-%if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
+%if 0%{?fc20} || 0%{?el7}
 Provides: rubygem(%{gem_name}) = %{version}
 %endif
 
@@ -48,6 +51,8 @@ gem unpack %{SOURCE0}
 
 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
 
+%patch0 -p1
+
 # Remove dependency on bundler.
 sed -i -e "/require 'bundler'/d" spec/spec_helper.rb
 sed -i -e "/Bundler.setup/d" spec/spec_helper.rb
@@ -65,8 +70,8 @@ gem build %{gem_name}.gemspec
 
 %install
 mkdir -p %{buildroot}%{gem_dir}
-cp -pa .%{gem_dir}/* \
-        %{buildroot}%{gem_dir}/
+cp -a .%{gem_dir}/* \
+       %{buildroot}%{gem_dir}/
 
 %check
 pushd .%{gem_instdir}
@@ -86,8 +91,9 @@ popd
 
 
 %files
+%{!?_licensedir:%global license %%doc}
 %dir %{gem_instdir}
-%doc %{gem_instdir}/LICENSE
+%license %{gem_instdir}/LICENSE
 %doc %{gem_instdir}/README.md
 %{gem_libdir}
 %exclude %{gem_cache}
@@ -98,6 +104,12 @@ popd
 %exclude %{gem_instdir}/spec
 
 %changelog
+* Sun Apr 05 2015 Ken Dreyer <ktdreyer at ktdreyer.com> - 1.5.2-2
+- Update to 1.5.2 (RHBZ #1207454)
+- Drop Fedora 19 conditionals
+- Patch for rspec 3 support
+- Use %%license macro
+
 * Thu Sep 11 2014 Ken Dreyer <ktdreyer at ktdreyer.com> - 1.5.1-1
 - Update to 1.5.1 (RHBZ #1126616)
 
diff --git a/sources b/sources
index 2618a53..d478caa 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-56b4532129ce9ae4728efeda5e0ff09a  redis-namespace-1.5.1.gem
+fa018c37656ffe772faeecfa6627bf4e  redis-namespace-1.5.2.gem
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/rubygem-redis-namespace.git/commit/?h=master&id=b0a7bb040978d600bd3d270f6c5ccbef0fdb7ec0


More information about the scm-commits mailing list