diff --git a/lib/redis/namespace.rb b/lib/redis/namespace.rb index fa3b34d..96266dc 100644 --- a/lib/redis/namespace.rb +++ b/lib/redis/namespace.rb @@ -59,7 +59,7 @@ class Namespace "bitop" => [ :exclude_first ], "blpop" => [ :exclude_last, :first ], "brpop" => [ :exclude_last, :first ], - "brpoplpush" => [ :exclude_last ], + "brpoplpush" => [ :first_two ], "debug" => [ :exclude_first ], "decr" => [ :first ], "decrby" => [ :first ], @@ -367,6 +367,9 @@ def call_with_namespace(command, *args, &block) case before when :first args[0] = add_namespace(args[0]) if args[0] + when :first_two + args[0] = add_namespace(args[0]) if args[0] + args[1] = add_namespace(args[1]) if args[1] when :all args = add_namespace(args) when :exclude_first diff --git a/spec/redis_spec.rb b/spec/redis_spec.rb index 885b4dc..0fe952c 100644 --- a/spec/redis_spec.rb +++ b/spec/redis_spec.rb @@ -84,6 +84,13 @@ @namespaced.lrange('bar',0,-1).should eq(['bar']) end + it 'should be able to use a namespace with brpoplpush with default timeout' do + @namespaced.lpush('foo','bar') + @namespaced.brpoplpush('foo','bar').should eq('bar') + @namespaced.lrange('foo',0,-1).should eq([]) + @namespaced.lrange('bar',0,-1).should 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)