check directory exists before attempting to clear it

This commit is contained in:
Brian Gough
2016-03-31 11:43:36 +01:00
parent 3dcd4af62e
commit bd036534e5
2 changed files with 28 additions and 8 deletions

View File

@@ -99,6 +99,7 @@ describe "CompileManager", ->
describe "succesfully", ->
beforeEach ->
@Settings.compileDir = "compiles"
@fs.lstat = sinon.stub().callsArgWith(1, null,{isDirectory: ()->true})
@proc = new EventEmitter()
@proc.stdout = new EventEmitter()
@proc.stderr = new EventEmitter()
@@ -117,6 +118,7 @@ describe "CompileManager", ->
describe "with a non-success status code", ->
beforeEach ->
@Settings.compileDir = "compiles"
@fs.lstat = sinon.stub().callsArgWith(1, null,{isDirectory: ()->true})
@proc = new EventEmitter()
@proc.stdout = new EventEmitter()
@proc.stderr = new EventEmitter()