- @file.get_text(@x1,@y1,@x2,@y2) == text or raise AreaError.new(self, "doesn't contain text #{text}")
+ text2 = @file.get_text(@x1,@y1,@x2,@y2)
+ text2 == text or raise AreaError.new(self, "doesn't contain text \"#{text}\" (found: \"#{text2}\")")
+ 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}\")