Skip to content

Commit

Permalink
Merge pull request #171 from Tolsto/feature/new-exists-api
Browse files Browse the repository at this point in the history
Support variadic exists and exists?
  • Loading branch information
rafaelfranca committed Aug 19, 2020
2 parents c8b6764 + cc09dc3 commit 8e7f45e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/redis_spec.rb
Expand Up @@ -144,6 +144,18 @@
expect(@namespaced.get('virgin_key')).to eq(@namespaced.getrange('virgin_key',0,-1))
end

it 'should be able to use a namespace with exists' do
@namespaced.set('foo', 1000)
@namespaced.set('bar', 2000)
expect(@namespaced.exists('foo', 'bar')).to eq(2)
end

it 'should be able to use a namespace with exists?' do
@namespaced.set('foo', 1000)
@namespaced.set('bar', 2000)
expect(@namespaced.exists?('does_not_exist', 'bar')).to eq(true)
end

it 'should be able to use a namespace with bitpos' do
@namespaced.setbit('bit_map', 42, 1)
expect(@namespaced.bitpos('bit_map', 0)).to eq(0)
Expand Down

0 comments on commit 8e7f45e

Please sign in to comment.