Another commit
[erd-marker.git] / spec / erd_handler / erd_spec.rb
1 require 'spec_helper'
2
3 module ErdHandler
4 describe Erd do
5 let(:input) { double('input').as_null_object }
6 let(:output) { double('output').as_null_object }
7 let(:erd) { Erd.new(input, output) }
8
9 describe "#initialize" do
10 it "creates an empty ERD" do
11 erd = Erd.new
12 erd.mark.should be_nil
13 erd.should have(0).vertices
14 erd.should have(0).edges
15 end
16
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
22 end
23
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
29 end
30
31 it "reads and creates a box with a self-loop"
32 end # #initialize
33 end
34 end