class PageValidations::HaveValidHTML

Public Class Methods

show_html_in_failures=(val) click to toggle source
# File lib/html_validation/have_valid_html.rb, line 13
def self.show_html_in_failures=(val)
  @@html_in_failures = val
end

Public Instance Methods

description() click to toggle source
# File lib/html_validation/have_valid_html.rb, line 23
def description
  "have valid HTML"
end
failure_message()
failure_message_for_should() click to toggle source
# File lib/html_validation/have_valid_html.rb, line 27
def failure_message_for_should
  "#{@v.resource} Invalid html (fix or run 'html_validation review' to add exceptions)\n#{@v.resource} exceptions:\n #{@v.exceptions}\n\n #{@v.html if @@html_in_failures}"
end
Also aliased as: failure_message
failure_message_for_should_not() click to toggle source
# File lib/html_validation/have_valid_html.rb, line 32
def failure_message_for_should_not
  "#{@v.resource} Expected valid? to fail but didn't. Did you accidentally accept these validation errors?  \n#{@v.resource} exceptions:\n #{@v.exceptions}\n\n #{@v.html if @@html_in_failures}"
end
Also aliased as: failure_message_when_negated
failure_message_when_negated()
matches?(page) click to toggle source
# File lib/html_validation/have_valid_html.rb, line 17
def matches?(page)
  h  = HTMLValidation.new
  @v = h.validation(page.body, page.current_url)
  @v.valid?
end