remove stat test for missing files

This commit is contained in:
Brian Gough
2017-09-26 09:48:09 +01:00
parent 0930b1cd8f
commit f11468b595
2 changed files with 5 additions and 33 deletions

View File

@@ -88,27 +88,12 @@ describe "ResourceStateManager", ->
it "should call the callback", ->
@callback.calledWithExactly().should.equal true
describe "when there is a file missing from the outputFileFinder but present on disk", ->
beforeEach ->
@allFiles = [ @resources[0].path, @resources[1].path]
@fs.stat = sinon.stub().callsArg(1)
@ResourceStateManager.checkResourceFiles(@resources, @allFiles, @basePath, @callback)
it "should stat the file to see if it is present", ->
@fs.stat.called.should.equal true
it "should call the callback", ->
@callback.calledWithExactly().should.equal true
describe "when there is a missing file", ->
beforeEach ->
@allFiles = [ @resources[0].path, @resources[1].path]
@fs.stat = sinon.stub().callsArgWith(1, new Error())
@ResourceStateManager.checkResourceFiles(@resources, @allFiles, @basePath, @callback)
it "should stat the file to see if it is present", ->
@fs.stat.called.should.equal true
it "should call the callback with an error", ->
error = new Errors.FilesOutOfSyncError("resource files missing in incremental update")
@callback.calledWith(error).should.equal true