123456789_123456789_123456789_123456789_123456789_

Module: Capybara::RSpecMatchers::Matchers::Compound::Synchronizer Private

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
And, Or
Defined in: lib/capybara/rspec/matchers/compound.rb

Instance Method Summary

Instance Method Details

#match(_expected, actual)

[ GitHub ]

  
# File 'lib/capybara/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)

[ GitHub ]

  
# File 'lib/capybara/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