|
@@ -88,27 +88,12 @@ describe "ResourceStateManager", ->
|
|
|
it "should call the callback", ->
|
|
it "should call the callback", ->
|
|
|
@callback.calledWithExactly().should.equal true
|
|
@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", ->
|
|
describe "when there is a missing file", ->
|
|
|
beforeEach ->
|
|
beforeEach ->
|
|
|
@allFiles = [ @resources[0].path, @resources[1].path]
|
|
@allFiles = [ @resources[0].path, @resources[1].path]
|
|
|
@fs.stat = sinon.stub().callsArgWith(1, new Error())
|
|
@fs.stat = sinon.stub().callsArgWith(1, new Error())
|
|
|
@ResourceStateManager.checkResourceFiles(@resources, @allFiles, @basePath, @callback)
|
|
@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", ->
|
|
it "should call the callback with an error", ->
|
|
|
error = new Errors.FilesOutOfSyncError("resource files missing in incremental update")
|
|
error = new Errors.FilesOutOfSyncError("resource files missing in incremental update")
|
|
|
@callback.calledWith(error).should.equal true
|
|
@callback.calledWith(error).should.equal true
|