     @Rimraf = sinon.stub()
     @LocalFileWriter =
       writeStream: sinon.stub()
+      deleteFile: sinon.stub()
     @requires =
       "./LocalFileWriter":@LocalFileWriter
       "fs":@Fs

    @FSPersistorManager = SandboxedModule.require modulePath, requires: @requires

  describe "sendFile", ->
    it "should put the file", (done) ->
      @Fs.rename.callsArgWith(2,@error)
      @FSPersistorManager.sendFile @location, @name1, @name2, (err)=>
        @Fs.rename.calledWith( @name2, "#{@location}/#{@name1Filtered}" ).should.equal true
        err.should.equal @error
        done()


    beforeEach ->
      @FSPersistorManager.sendFile = sinon.stub().callsArgWith(3)
      @LocalFileWriter.writeStream.callsArgWith(2, null, @name1)
      @LocalFileWriter.deleteFile.callsArg(1)
      @SourceStream =
        on:->

