module Capybara::RSpecMatchers::Matchers::Compound::Synchronizer

@api private

Public Instance Methods

match(_expected, actual) click to toggle source
# File lib/isomorfeus/puppetmaster/rspec/matchers/compound.rb, line 39
def match(_expected, actual)
  @evaluator = CapybaraEvaluator.new(actual)
  syncer = sync_element(actual)
  begin
    syncer.synchronize do
      @evaluator.reset
      raise ::Capybara::ElementNotFound unless synchronized_match?

      true
    end
  rescue StandardError
    false
  end
end
sync_element(el) click to toggle source
# File lib/isomorfeus/puppetmaster/rspec/matchers/compound.rb, line 54
def sync_element(el)
  if el.respond_to? :synchronize
    el
  elsif el.respond_to? :current_scope
    el.current_scope
  else
    Capybara.string(el)
  end
end