Merged in SimpleCov from master#
[graph.njae.git] / spec / graph / edge_spec.rb
index 938890fcb251f1e333a5305968fd2d2f391d2df6..23537560ba40be5ce0ef39d277710951b8f43081 100644 (file)
@@ -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 == '<E: test [<V: v1>, <V: v2>] >'
+      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