module Capybara::Screenshot::RSpec::HtmlLinkReporter

Public Instance Methods

extra_failure_content_with_screenshot(exception) click to toggle source
# File lib/capybara-screenshot/rspec/html_link_reporter.rb, line 12
def extra_failure_content_with_screenshot(exception)
  result  = extra_failure_content_without_screenshot(exception)
  example = @failed_examples.last
  if (screenshot = example.metadata[:screenshot])
    result << "<p>Saved files: "
    result << link_to_screenshot("HTML page",  screenshot[:html]) if screenshot[:html]
    result << link_to_screenshot("Screenshot", screenshot[:image]) if screenshot[:image]
    result << "</p>"
  end
  result
end