X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=spec%2Fgraph%2Fedge_spec.rb;h=f4be16b5e3787353e08e5261133d47f83cc06edb;hb=e2bfe13863188f286cdfda010aac750591a7e027;hp=8fc71ba76c5bfa42b7ee3843e32d144c3a111e5a;hpb=2978dd081219adda6952feb65b1782cfe749f133;p=graph.njae.git diff --git a/spec/graph/edge_spec.rb b/spec/graph/edge_spec.rb index 8fc71ba..f4be16b 100644 --- a/spec/graph/edge_spec.rb +++ b/spec/graph/edge_spec.rb @@ -25,6 +25,16 @@ module GraphNjae end end # adds attributes + describe "#to_s" do + it "returns the string form of an edge" do + v1 = Vertex.new :name => :v1 + v2 = Vertex.new :name => :v2 + e.type = :test + e << v1 << v2 + e.to_s.should == ', ] >' + end + end + describe "#<<" do it "adds a new vertex to an edge (with a connection)" do e.connections.should be_empty