Skip to content

Commit f9259a6

Browse files
francois-ferrandisPatrickTulskie
authored andcommitted
1 parent 44447f2 commit f9259a6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Diff for: lib/redis/namespace.rb

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ class Namespace
104104
"linsert" => [ :first ],
105105
"llen" => [ :first ],
106106
"lpop" => [ :first ],
107+
"lpos" => [ :first ],
107108
"lpush" => [ :first ],
108109
"lpushx" => [ :first ],
109110
"lrange" => [ :first ],

Diff for: spec/redis_spec.rb

+6
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@
100100
expect(@redis.get('foo')).to eq('bar')
101101
end
102102

103+
it 'should be able to use a namespace with lpos' do
104+
@namespaced.rpush('foo', %w[a b c 1 2 3 c c])
105+
expect(@namespaced.lpos('foo', 'c')).to eq(2)
106+
expect(@redis.lpos('mykey', 'c')).to be_nil
107+
end
108+
103109
it 'should be able to use a namespace with brpoplpush' do
104110
@namespaced.lpush('foo','bar')
105111
expect(@namespaced.brpoplpush('foo','bar',0)).to eq('bar')

0 commit comments

Comments
 (0)