module HTTP
  class Client
    alias_method :__perform__, :perform

    def perform(request, options)
      return __perform__(request, options) unless webmock_enabled?
      WebMockPerform.new(request) { __perform__(request, options) }.exec
    end

    def webmock_enabled?
      ::WebMock::HttpLibAdapters::HttpRbAdapter.enabled?
    end
  end
end

module HTTP
  class Client
    alias_method :__perform__, :perform

    def perform(request, options)
      return __perform__(request, options) unless webmock_enabled?
       
      response = options.features.inject(response) do |response, (_name, feature)|
        feature.wrap_response(response)
      end
      response
    end

    def webmock_enabled?
      ::WebMock::HttpLibAdapters::HttpRbAdapter.enabled?
    end
  end
end

Adjust `perform` override and call HTTP features wrapping request/response pairs.
Adjust `perform` override and call HTTP features wrapping request/response pairs.

The change helps reduce differences between mocking and not mocking to successfully test e.g. instrumentation which the `http` gem exposes through said features.
