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: session_spec.rb
    path of file: ./repos/puppet/spec/unit/http
    
    the code of the file until where you have to start completion: require 'spec_helper'
require 'puppet/http'

describe Puppet::HTTP::Session do
  let(:ssl_context) { Puppet::SSL::SSLContext.new }
  let(:client) { Puppet::HTTP::Client.new(ssl_context: ssl_context) }
  let(
    
  def create_bad_service(failure_message = 'whoops')
    service = double('bad', url: uri)
    allow(service).to receive(:connect).and_raise(Puppet::HTTP::ConnectionError, failure_message)
    service
  end

  class DummyResolver < Puppet::HTTP::Resolver
    attr_reader :count

    def initialize(service)
      @service = service
      @count = 0
    end

    def resolve(session, name, ssl_context: nil, canceled_handler: nil)
      @count += 1
      return @service if check_connection?(session, @service, ssl_context: ssl_context)
    end
  end