X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=spec%2Fgraph%2Fedge_spec.rb;h=837386421ef66ae70e726a8404b9e9a9f6669121;hb=804c1d3850e599aea8cb3258d1a875be148a3b30;hp=2e7dbfcc9a64863648ed928699155ea173c004b0;hpb=0908114d61c0effab6a568dd47053244df92cde8;p=graph.njae.git diff --git a/spec/graph/edge_spec.rb b/spec/graph/edge_spec.rb index 2e7dbfc..8373864 100644 --- a/spec/graph/edge_spec.rb +++ b/spec/graph/edge_spec.rb @@ -8,6 +8,15 @@ module GraphNjae e = Edge.new e.connections.should be_empty end + + it "creates an edge with some parameters" do + e = Edge.new :value1 => 1, :value2 => "value2", :value3 => :v3 + e.value1.should == 1 + e.value2.should == "value2" + e.value3.should == :v3 + e.value4.should be_nil + end + end # #initialize describe "adds attribues" do @@ -26,11 +35,13 @@ module GraphNjae e.should have(1).connections e.should have(1).vertices e.vertices.should include(v1) + v1.edges.should include(e) e << v2 e.should have(2).connections e.should have(2).vertices e.vertices.should include(v1) e.vertices.should include(v2) + v2.edges.should include(e) end it "adds several vertices to an edge" do