module Test::Unit::Capybara::ElementNotFoundHandler

@private

Public Class Methods

included(base) click to toggle source
# File lib/test/unit/capybara.rb, line 102
def included(base)
  base.exception_handler(:handle_capybara_element_not_found)
end

Private Instance Methods

handle_capybara_element_not_found(exception) click to toggle source
# File lib/test/unit/capybara.rb, line 108
def handle_capybara_element_not_found(exception)
  return false unless exception.is_a?(ElementNotFound)
  return false unless respond_to?(:flunk_find)
  begin
    flunk_find(exception.node,
               :kind => exception.kind,
               :locator => exception.locator)
  rescue AssertionFailedError => assertion_failed_error
    assertion_failed_error.backtrace.replace(exception.backtrace)
    handle_exception(assertion_failed_error)
  end
end