Skip to content

Commit

Permalink
linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
okhwaja authored and sds committed Sep 13, 2019
1 parent 66352c2 commit f8c1877
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/mock_redis/zset_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,20 @@ def zrem(key, *args)
retval
end

def zpopmin(key, count=1)
def zpopmin(key, count = 1)
with_zset_at(key) do |z|
pairs = z.sorted.first(count)
pairs.each { |pair| z.delete?(pair.last) }
retval = to_response(pairs, { with_scores: true })
retval = to_response(pairs, with_scores: true)
count == 1 ? retval.first : retval
end
end

def zpopmax(key, count=1)
def zpopmax(key, count = 1)
with_zset_at(key) do |z|
pairs = z.sorted.reverse.first(count)
pairs.each { |pair| z.delete?(pair.last) }
retval = to_response(pairs, { with_scores: true })
retval = to_response(pairs, with_scores: true)
count == 1 ? retval.first : retval
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/commands/zpopmax_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

it 'returns the entire set' do
before = @redises.zrange(@key, 0, count, with_scores: true).reverse
@redises.zpopmax(@key,count).should == before
@redises.zpopmax(@key, count).should == before
@redises.zcard(@key).should == 0
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/commands/zpopmin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

it 'returns the entire set' do
before = @redises.zrange(@key, 0, count, with_scores: true)
@redises.zpopmin(@key,count).should == before
@redises.zpopmin(@key, count).should == before
@redises.zcard(@key).should == 0
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def method_from_description(example)
end

def args_for_method(method)
return [] if ['spop', 'zpopmin', 'zpopmax'].include?(method.to_s)
return [] if %w[spop zpopmin zpopmax].include?(method.to_s)
method_arity = @redises.real.method(method).arity
if method_arity < 0 # -1 comes from def foo(*args)
[1, 2] # probably good enough
Expand Down

0 comments on commit f8c1877

Please sign in to comment.