projects
/
graph.njae.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed typo in graph.rb
[graph.njae.git]
/
spec
/
graph
/
edge_spec.rb
diff --git
a/spec/graph/edge_spec.rb
b/spec/graph/edge_spec.rb
index 8bd1f9abf17d9826ac530e0d460fec5c77caf79d..837386421ef66ae70e726a8404b9e9a9f6669121 100644
(file)
--- a/
spec/graph/edge_spec.rb
+++ b/
spec/graph/edge_spec.rb
@@
-1,6
+1,6
@@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
-module Graph
+module Graph
Njae
describe Edge do
let (:e) { Edge.new }
describe "#initialize" do
describe Edge do
let (:e) { Edge.new }
describe "#initialize" do
@@
-8,6
+8,15
@@
module Graph
e = Edge.new
e.connections.should be_empty
end
e = Edge.new
e.connections.should be_empty
end
+
+ it "creates an edge with some parameters" do
+ e = Edge.new :value1 => 1, :value2 => "value2", :value3 => :v3
+ e.value1.should == 1
+ e.value2.should == "value2"
+ e.value3.should == :v3
+ e.value4.should be_nil
+ end
+
end # #initialize
describe "adds attribues" do
end # #initialize
describe "adds attribues" do
@@
-26,11
+35,13
@@
module Graph
e.should have(1).connections
e.should have(1).vertices
e.vertices.should include(v1)
e.should have(1).connections
e.should have(1).vertices
e.vertices.should include(v1)
+ v1.edges.should include(e)
e << v2
e.should have(2).connections
e.should have(2).vertices
e.vertices.should include(v1)
e.vertices.should include(v2)
e << v2
e.should have(2).connections
e.should have(2).vertices
e.vertices.should include(v1)
e.vertices.should include(v2)
+ v2.edges.should include(e)
end
it "adds several vertices to an edge" do
end
it "adds several vertices to an edge" do