           .cancel new CustomCancellationError
 
         setImmediate ->
-          expect(abortSpy.called).to.be.true
+          expect(request.Request.prototype.abort.called).to.be.true
           done()
 
       it 'should throw a custom error when the promise is

        expect(error.message.code).to.equal("ECONNREFUSED")

  describe 'cancellable promises', ->
    oldAbort = undefined
    abortSpy = undefined

    beforeEach ->
      oldAbort = request.Request.prototype.abort
      request.Request.prototype.abort = abortSpy = sinon.spy()

    afterEach ->
      request.Request.prototype.abort = oldAbort

    describe 'cancel without reason', ->


          .cancel()

        setImmediate ->
          expect(request.Request.prototype.abort.called).to.be.true
          done()

      it 'should throw a bluebird CancellationError when the
