class Capybara::Queries::SiblingQuery

def resolve_for(node, exact = nil)

Other tags:
    Api: - private
def resolve_for(node, exact = nil)
  @sibling_node = node
  node.synchronize do
    match_results = super(node.session.current_scope, exact)
    node.all(:xpath, XPath.preceding_sibling + XPath.following_sibling) do |el|
      match_results.include?(el)
    end
  end
end