require "./spec_helper" describe Crystal::Scatter do # TODO: Write tests it "add elements" do rg = Crystal::Scatter::RingGraph.new rg.add(UInt64.new(1),[0,0,0,0,0,0],"OSD0") rg.add(UInt64.new(1),[0,0,0,0,0,1],"OSD1") rg.add(UInt64.new(1),[0,0,0,0,1,0],"OSD2") rg.get_weight.should eq(3) rg.generate_ring(BigRational.new(1)) rg[0][0][0][0][0][0].range_effector.not_nil!.[0].should eq(0) rg[0][0][0][0][1][0].range_effector.not_nil!.[1].should eq(UInt64::MAX) end end