12ef23972e4674b8580e2b03eb6cb40c69797243
5 let(:input) { double('input').as_null_object
}
6 let(:output) { double('output').as_null_object
}
7 let(:erd) { Erd
.new(input
, output
) }
9 describe
"#initialize" do
10 it
"creates an empty ERD" do
12 erd
.mark
.should be_nil
13 erd
.should
have(0).vertices
14 erd
.should
have(0).edges
17 it
"reads and creates a single box" do
18 erd
= Erd
.new(File
.new("spec/fixtures/single_box_erd.xml"))
19 erd
.mark
.should
== 6.5
20 erd
.should
have(1).vertices
21 erd
.should
have(0).edges
24 it
"reads and creates two boxes with an edge joining them" do
25 erd
= Erd
.new(File
.new("spec/fixtures/two_boxes_one_link_erd.xml"))
26 erd
.mark
.should
== 4.5
27 erd
.should
have(2).vertices
28 erd
.should
have(1).edges
30 erd
.vertices
[0].neighbours
.should
include(erd
.vertices
[1])
31 erd
.vertices
[1].neighbours
.should
include(erd
.vertices
[0])
34 it
"reads and creates a box with a self-loop"