Skip to content

Commit

Permalink
coverage for non-coercible types
Browse files Browse the repository at this point in the history
  • Loading branch information
Pinny Markowitz committed Mar 30, 2020
1 parent 5d3a549 commit 72085b3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/commands/zinterstore_spec.rb
Expand Up @@ -63,6 +63,19 @@
end
end

context 'when used with a non-coercible structure' do
before do
@non_set = 'mock-redis-test:zinterstore:non-set'

@redises.set(@non_set, 'one')
end
it 'raises an error for wrong value type' do
lambda do
@redises.zinterstore(@dest, [@odds, @non_set])
end.should raise_error(Redis::CommandError)
end
end

context 'the :weights argument' do
it 'multiplies the scores by the weights while aggregating' do
@redises.zinterstore(@dest, [@odds, @primes], :weights => [2, 3])
Expand Down
13 changes: 13 additions & 0 deletions spec/commands/zunionstore_spec.rb
Expand Up @@ -62,6 +62,19 @@
end
end

context 'when used with a non-coercible structure' do
before do
@non_set = 'mock-redis-test:zunionstore4'

@redises.set(@non_set, 'one')
end
it 'raises an error for wrong value type' do
lambda do
@redises.zunionstore(@dest, [@set1, @non_set])
end.should raise_error(Redis::CommandError)
end
end

context 'the :weights argument' do
it 'multiplies the scores by the weights while aggregating' do
@redises.zunionstore(@dest, [@set1, @set2, @set3], :weights => [2, 3, 5])
Expand Down

0 comments on commit 72085b3

Please sign in to comment.