spec/commands/ltrim_spec.rb in mock_redis-0.5.4 vs spec/commands/ltrim_spec.rb in mock_redis-0.5.5
- old
+ new
@@ -14,9 +14,14 @@
it "trims the list to include only the specified elements" do
@redises.ltrim(@key, 1, 3)
@redises.lrange(@key, 0, -1).should == %w[v1 v2 v3]
end
+ it "trims the list when start and stop are strings" do
+ @redises.ltrim(@key, '1', '3')
+ @redises.lrange(@key, 0, -1).should == %w[v1 v2 v3]
+ end
+
it "trims the list to include only the specified elements (negative indices)" do
@redises.ltrim(@key, -2, -1)
@redises.lrange(@key, 0, -1).should == %w[v3 v4]
end