Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (21 sloc) 0.471 kB
class SpecDoc
def initialize(response)
@html = Nokogiri::HTML(response.body)
end
def method_missing(method, *args)
@html.send method, *args
end
def has_content?(string)
escaped = string.gsub("'", "\\'")
@html.xpath("//*[contains(text(), '#{escaped}')]").any?
end
def has_no_content?(string)
! has_content?(string)
end
def has_link?(text)
@html.xpath("//a[text()='#{text}']").any?
end
end
def doc
SpecDoc.new response
end
Jump to Line
Something went wrong with that request. Please try again.