projects
/
graph.njae.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Regenerate gemspec for version 0.2.4
[graph.njae.git]
/
spec
/
graph
/
graph_spec.rb
diff --git
a/spec/graph/graph_spec.rb
b/spec/graph/graph_spec.rb
index 7227a6f8e1abdf60b25efe5bc419ca2c8a861ba4..09cc6a433cddd36d28d78fa4c09fc9f2542450da 100644
(file)
--- a/
spec/graph/graph_spec.rb
+++ b/
spec/graph/graph_spec.rb
@@
-1,6
+1,13
@@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
-module Graph
+module GraphNjae
+
+ class SVertex < Vertex
+ end
+
+ class SEdge < Edge
+ end
+
describe Graph do
let (:g) { Graph.new }
describe "#initialize" do
describe Graph do
let (:g) { Graph.new }
describe "#initialize" do
@@
-54,6
+61,16
@@
module Graph
g.edges.should include(e1)
g.edges.should include(e2)
end
g.edges.should include(e1)
g.edges.should include(e2)
end
+
+ it "adds a subclass of Vertex" do
+ g.vertices.should be_empty
+ v1 = SVertex.new
+ v2 = SVertex.new
+ g << v1 << v2
+ g.should have(2).vertices
+ g.vertices.should include(v1)
+ g.vertices.should include(v2)
+ end
end # #<<
describe "connect" do
end # #<<
describe "connect" do