Fiddling around with labels and boxes
[erd-marker.git] / spec / erd_handler / box_spec.rb
index 82005d6d9f019a39c6d6c6f61affd15141438f93..1d47ed701ed5ec6c9c31ee00be9236e69b006e17 100644 (file)
@@ -36,7 +36,17 @@ module ErdHandler
         b1.within?(b3).should == false
         b3.within?(b1).should == false
       end
-    end # contains?
+    end # within?
+    
+    describe "#similarity" do
+      it "find the similarity of two boxes" do 
+        b1 = Box.new
+        b1.name = Label.new "box 1", true
+        b2 = Box.new
+        b2.name = Label.new "box 2", true
+        b1.similarity(b2).should be_within(0.005).of(0.75)
+      end
+    end
 
   end
 end