0
@@ -2,7 +2,113 @@ require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")
0
require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
0
describe IntervalSkipList do
0
-
describe "#expire_range" do0
+
it_should_behave_like "the palindromic fixture"0
+ describe "when 7..7 is expired with a length change of 0" do
0
+ attr_reader :nodes, :node
0
+ it "has a size of 4" do
0
+ nodes.size.should == 4
0
+ it "has a key of 1 and a height of 3" do
0
+ node.height.should == 3
0
+ it "has no forward markers at level 0" do
0
+ node.forward_markers[0].should be_empty
0
+ it "has :a and :b as its only forward markers on level 1" do
0
+ node.forward_markers[1].should have_markers(:a, :b)
0
+ it "has :c as its only forward marker on level 2" do
0
+ node.forward_markers[2].should have_markers(:c)
0
+ it "has no markers" do
0
+ node.markers.should be_empty
0
+ it "has a key of 3 and a height of 2" do
0
+ node.height.should == 2
0
+ it "has :b as its only forward marker on level 0" do
0
+ node.forward_markers[0].should have_markers(:b)
0
+ it "has no forward markers on level 1" do
0
+ node.forward_markers[1].should be_empty
0
+ it "has :a and :b as its only markers" do
0
+ node.markers.should have_markers(:a, :b)
0
+ it "has a key of 5 and a height of 1" do
0
+ node.height.should == 1
0
+ it "has no forward markers on level 0" do
0
+ node.forward_markers[0].should be_empty
0
+ it "has :b as its only marker" do
0
+ node.markers.should have_markers(:b)
0
+ it "has a key of 7 and a height of 3" do
0
+ node.height.should == 3
0
+ it "has no forward markers at any level" do
0
+ node.forward_markers[0].should be_empty
0
+ node.forward_markers[1].should be_empty
0
+ node.forward_markers[2].should be_empty
0
+ it "has :c as its only marker" do
0
+ node.markers.should have_markers(:c)
0
\ No newline at end of file
Comments
No one has commented yet.