Skip to content

Commit f7645ee

Browse files
authored
Merge pull request #96 from etiennebarrie/add-list-ltrim
Add `LTRIM` to lists
2 parents 48ffc65 + b11d445 commit f7645ee

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/kredis/types/list.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Kredis::Types::List < Kredis::Types::Proxying
2-
proxying :lrange, :lrem, :lpush, :rpush, :exists?, :del
2+
proxying :lrange, :lrem, :lpush, :ltrim, :rpush, :exists?, :del
33

44
attr_accessor :typed
55

test/types/list_test.rb

+6
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,10 @@ class ListTest < ActiveSupport::TestCase
5757
@list.append(%w[ 1 2 3 ])
5858
assert @list.exists?
5959
end
60+
61+
test "ltrim" do
62+
@list.append(%w[ 1 2 3 4 ])
63+
@list.ltrim(-3, -2)
64+
assert_equal %w[ 2 3 ], @list.elements
65+
end
6066
end

0 commit comments

Comments
 (0)