use TikzManager to create main file for pstool package

This commit is contained in:
Brian Gough
2018-10-10 16:13:20 +01:00
parent 6d1545a40e
commit 49ddcee0c6
3 changed files with 25 additions and 7 deletions

View File

@@ -65,6 +65,22 @@ describe 'TikzManager', ->
@callback.calledWithExactly(null, false)
.should.equal true
describe "and the main file contains \\usepackage{pstool}", ->
beforeEach ->
@SafeReader.readFile = sinon.stub()
.withArgs("#{@compileDir}/#{@mainFile}")
.callsArgWith(3, null, "hello \\usepackage[random-options]{pstool}")
@TikzManager.checkMainFile @compileDir, @mainFile, @resources, @callback
it "should look at the file on disk", ->
@SafeReader.readFile
.calledWith("#{@compileDir}/#{@mainFile}")
.should.equal true
it "should call the callback with true ", ->
@callback.calledWithExactly(null, true)
.should.equal true
describe "injectOutputFile", ->
beforeEach ->
@rootDir = "/mock"