X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=spec%2Ferd_handler%2Ferd_spec.rb;fp=spec%2Ferd_handler%2Ferd_spec.rb;h=77d7ad2b42dbf19531a3684ea4a41cb23fbbcb31;hb=f55cef415b384cf2004cf984cb0aaf6bd87ee922;hp=6b33dd8e3dbfc92238b3c76aadcb5b5201103079;hpb=fdc3bc03b2d7759927ae34d5382d2168be6a2bae;p=erd-marker.git diff --git a/spec/erd_handler/erd_spec.rb b/spec/erd_handler/erd_spec.rb index 6b33dd8..77d7ad2 100644 --- a/spec/erd_handler/erd_spec.rb +++ b/spec/erd_handler/erd_spec.rb @@ -71,6 +71,20 @@ module ErdHandler c1.should_not == c2 end + it "reads and creates an ERD with subclassing" do + erd = Erd.new + erd.read(File.new("spec/fixtures/two_boxes_one_contained_erd.xml")) + erd.mark.should == 4.5 + erd.should have(2).vertices + erd.should have(0).edges + + erd.vertices[0].should have(0).neighbours + erd.vertices[1].should have(0).neighbours + + erd.vertices[0].within?(erd.vertices[1]).should be(true) + erd.vertices[1].should be_contains(erd.vertices[0]) + end + it "reads and creates full diagram" do erd = Erd.new erd.read(File.new("spec/fixtures/complex_erd.xml"))