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: app_version_spec.rb
    path of file: ./repos/fastlane/spaceship/spec/tunes
    
    the code of the file until where you have to start completion: describe Spaceship::AppVersion, all: true do
  before { Spaceship
    
      def setup_handle_itc_potential_server_failure(nb_failures)
        @times_called = 0
        allow(client).to receive(:handle_itc_response) do |data|
          @times_called += 1
          raise Spaceship::TunesClient::ITunesConnectPotentialServerError, "simulated try again" if @times_called <= nb_failures
          update_success_data
        end
        # arbitrary stub to prevent mock network failures. We override itc_response
        TunesStubbing.itc_stub_valid_update
      end