# File lib/webmock/stub_registry.rb, line 17
    def global_stub_block=(block)
      self.global_stub = ::WebMock::RequestStub.new(:any, /.*/)

      # This hash contains the responses returned by the block,
      # keyed by the exact request (using the object_id).
      # That way, there's no race condition in case #to_return
      # doesn't run immediately after stub.with.
      responses = {}

      self.global_stub.with { |request|
        responses[request.object_id] = block.call(request)
      }.to_return(lambda { |request| responses.delete(request.object_id) })

      register_request_stub(self.global_stub)
    end