Added SimpleCov, added tests for Vertex#to_s and Edge#to_s
[graph.njae.git] / spec / graph / edge_spec.rb
index 8fc71ba76c5bfa42b7ee3843e32d144c3a111e5a..f4be16b5e3787353e08e5261133d47f83cc06edb 100644 (file)
@@ -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 == '<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