X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=spec%2Ferd_handler%2Fbox_spec.rb;h=1d47ed701ed5ec6c9c31ee00be9236e69b006e17;hb=fdc3bc03b2d7759927ae34d5382d2168be6a2bae;hp=82005d6d9f019a39c6d6c6f61affd15141438f93;hpb=7007758ddfedba0e7db623c2e6e2aba7bb420e73;p=erd-marker.git diff --git a/spec/erd_handler/box_spec.rb b/spec/erd_handler/box_spec.rb index 82005d6..1d47ed7 100644 --- a/spec/erd_handler/box_spec.rb +++ b/spec/erd_handler/box_spec.rb @@ -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