You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: current_url_spec.rb
    path of file: ./repos/capybara/lib/capybara/spec/session
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'capybara/spec/test_app'

Capybara::SpecHelper.spec '#current_url, #current_path, #current_host' do
  before :all do # rubocop:disable RSpec/BeforeAfterAll
    @servers = Array.new(2) { Capybara::Server.new(TestApp.new).boot }
    # sanity check
    expect(@servers[0].port).not_to eq(@servers[1].por
    
  def should_be_on(server_index, path = '/host', scheme = 'http')
    # Check that we are on /host on the given server
    s = @servers[server_index]

    expect(@session).to have_current_path("#{scheme}://#{s.host}:#{s.port}#{path}", url: true)

    expect(@session.current_url.chomp('?')).to eq("#{scheme}://#{s.host}:#{s.port}#{path}")
    expect(@session.current_host).to eq("#{scheme}://#{s.host}") # no port
    expect(@session.current_path).to eq(path.split('#')[0])
    # Server should agree with us
    expect(@session).to have_content("Current host is #{scheme}://#{s.host}:#{s.port}") if path == '/host'
  end