X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=spec%2Fgraph%2Fedge_spec.rb;h=23537560ba40be5ce0ef39d277710951b8f43081;hb=refs%2Fheads%2Fdot;hp=938890fcb251f1e333a5305968fd2d2f391d2df6;hpb=282a96d68535bd39b4dcd08ff805ccfcfd8b9f10;p=graph.njae.git diff --git a/spec/graph/edge_spec.rb b/spec/graph/edge_spec.rb index 938890f..2353756 100644 --- a/spec/graph/edge_spec.rb +++ b/spec/graph/edge_spec.rb @@ -29,8 +29,18 @@ module GraphNjae end end # adds attributes - describe '#<<' do - it 'adds a new vertex to an edge (with a connection)' do + 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 e << v1 e.should have(1).connections