fixed bug in links spec
authorMatthias Kramm <kramm@quiss.org>
Thu, 17 Sep 2009 12:56:37 +0000 (14:56 +0200)
committerMatthias Kramm <kramm@quiss.org>
Thu, 17 Sep 2009 12:56:37 +0000 (14:56 +0200)
spec/links.spec.rb
spec/spec_helper.rb

index 25e754d..35f92cc 100644 (file)
@@ -3,7 +3,6 @@ require File.dirname(__FILE__) + '/spec_helper'
 describe "pdf conversion" do
     convert_file "links.pdf" do
         area_at(0,0,200,200).should_contain_link("http://www.swftools.org")
-        area_at(0,0,200,200).should_contain_link("http://www.pdf2swf.org")
         area_at(0,0,200,200).should_contain_link("http://www.quiss.org")
     end
 end
index 876f1d4..bb11257 100644 (file)
@@ -58,7 +58,7 @@ class Area
     end
     def should_contain_link(url)
        links = @file.get_links(@x1,@y1,@x2,@y2) 
-       (links & [url]) or raise AreaError.new(self, "doesn't contain url \"#{url}\")
+       (links & [url]).empty? and raise AreaError.new(self, "doesn't contain url \"#{url}\"")
     end
     def to_s
        "(#{@x1},#{@y1},#{@x2},#{@y2})"