spec/zset_spec.rb in blendris-1.0 vs spec/zset_spec.rb in blendris-1.1
- old
+ new
@@ -11,6 +11,19 @@
z.set 1, "cat", 0, "dog"
z.delete "cat"
z.to_a.should == %w( dog )
end
+ it "should delete correctly" do
+ z = RedisSortedSet.new("set1")
+ z << [ [2, "timothy"], [1, "alexander"], [3, "mchale"], [0, "dog"], [7, "cat"] ]
+ z.delete_by_score 1, 3
+ z.to_a.should == %w( dog cat )
+ end
+
+ it "should accept hashes" do
+ z = RedisSortedSet.new("set1")
+ z << { 2 => "c", 0 => "a", 1 => "b" }
+ z.to_a.should == %w( a b c )
+ end
+
end