Permalink
Browse files

Add 'required by' messages, added vertex test

  • Loading branch information...
D4L committed Aug 9, 2012
1 parent 84ded36 commit 92091715442717c23efb877ba8c22dbb89874470
@@ -1,3 +1,5 @@
+# required in "abstract_graph"
+
require "abstract_graph/composition/vertex"
require "abstract_graph/composition/edge"
@@ -1,3 +1,5 @@
+# required in "abstract_graph/composition"
+
module AbstractGraph
module Composition
@@ -1,3 +1,5 @@
+# required in "abstract_graph/composition"
+
module AbstractGraph
module Composition
@@ -7,3 +9,5 @@ class Vertex
end
end
end
+
+require "abstract_graph/composition/vertex/initialize"
@@ -0,0 +1,13 @@
+# required in "abstract_graph/composition/vertex"
+
+module AbstractGraph
+ module Composition
+ class Vertex
+
+ def initialize name=""
+
+ end
+
+ end
+ end
+end
@@ -1,7 +1,11 @@
+# required in "abstract_graph"
+
module AbstractGraph
# public Graph class
class Graph
end
end
+
+require "abstract_graph/graph/initialize"
@@ -1,3 +1,5 @@
+# required in "abstract_graph/graph"
+
module AbstractGraph
class Graph
@@ -1,3 +1,5 @@
+# required in "abstract_graph"
+
module AbstractGraph
VERSION = "0.0.1"
end
@@ -3,9 +3,26 @@
describe AbstractGraph::Composition::Vertex do
describe "#new" do
+ before (:each) do
+ @vertex = AbstractGraph::Composition::Vertex.new
+ end
+
it "returns an object of class Vertex" do
- AbstractGraph::Composition::Vertex.new.class.should == AbstractGraph::Composition::Vertex
+ @vertex.should be_an_instance_of(AbstractGraph::Composition::Vertex)
+ end
+
+ end
+
+ describe "#new(String)" do
+
+ before (:each) do
+ @vertex = AbstractGraph::Composition::Vertex.new("v1")
+ end
+
+ it "allows vertices to be initiated with a string name" do
+ @vertex.should_not be_nil
end
end
+
end
@@ -3,8 +3,12 @@
describe AbstractGraph::Graph do
describe "#new" do
+ before(:each) do
+ @graph = AbstractGraph::Graph.new
+ end
+
it "returns an object of class Graph" do
- AbstractGraph::Graph.new.class.should == AbstractGraph::Graph
+ @graph.class.should == AbstractGraph::Graph
end
end

0 comments on commit 9209171

Please sign in to comment.