Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
heka1024 committed Feb 1, 2024
1 parent 6fd4413 commit 9cdb531
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions lib/kredis/types/unique_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def prepend(elements)
return if elements.empty?

with_expiration do

multi do
remove elements
super(elements, suppress_expiration: true)
Expand All @@ -26,7 +25,6 @@ def append(elements)
return if elements.empty?

with_expiration do

multi do
remove elements
super(elements, suppress_expiration: true)
Expand Down
10 changes: 5 additions & 5 deletions test/types/set_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ class SetTest < ActiveSupport::TestCase

@set.add 1.5, 2.7
@set << 2.7
assert_equal [1.5, 2.7], @set.members
assert_equal [ 1.5, 2.7 ], @set.members

@set.remove(2.7)
assert_equal [1.5], @set.members
assert_equal [ 1.5 ], @set.members

assert_equal 1.5, @set.take
end
Expand All @@ -98,8 +98,8 @@ class SetTest < ActiveSupport::TestCase
@set = Kredis.set "mylist", typed: :float
@set.add 1.5, 2.7

assert @set.sample.in?([1.5, 2.7])
assert_equal [1.5, 2.7], @set.sample(2).sort
assert @set.sample.in?([ 1.5, 2.7 ])
assert_equal [ 1.5, 2.7 ], @set.sample(2).sort
end

test "default" do
Expand Down Expand Up @@ -151,6 +151,6 @@ class SetTest < ActiveSupport::TestCase
@set = Kredis.set "mylist", typed: :integer, default: -> () { %w[ 1 2 3 ] }
@set.add(%w[ 5 6 7 ])
@set.replace(%w[ 8 9 10 ])
assert_equal [8, 9, 10], @set.members
assert_equal [ 8, 9, 10 ], @set.members
end
end

0 comments on commit 9cdb531

Please sign in to comment.