|
@@ -10,13 +10,9 @@ describe "FileConverter", ->
|
|
|
|
|
|
|
|
beforeEach ->
|
|
beforeEach ->
|
|
|
|
|
|
|
|
- @easyimage =
|
|
|
|
|
- convert:sinon.stub()
|
|
|
|
|
- exec: sinon.stub()
|
|
|
|
|
@child_process =
|
|
@child_process =
|
|
|
exec : sinon.stub()
|
|
exec : sinon.stub()
|
|
|
@converter = SandboxedModule.require modulePath, requires:
|
|
@converter = SandboxedModule.require modulePath, requires:
|
|
|
- "easyimage":@easyimage
|
|
|
|
|
'child_process': @child_process
|
|
'child_process': @child_process
|
|
|
"logger-sharelatex":
|
|
"logger-sharelatex":
|
|
|
log:->
|
|
log:->
|
|
@@ -55,7 +51,7 @@ describe "FileConverter", ->
|
|
|
done()
|
|
done()
|
|
|
|
|
|
|
|
describe "thumbnail", ->
|
|
describe "thumbnail", ->
|
|
|
- it "should call easy image resize with args", (done)->
|
|
|
|
|
|
|
+ it "should call converter resize with args", (done)->
|
|
|
@child_process.exec.callsArgWith(2)
|
|
@child_process.exec.callsArgWith(2)
|
|
|
@converter.thumbnail @sourcePath, (err)=>
|
|
@converter.thumbnail @sourcePath, (err)=>
|
|
|
args = @child_process.exec.args[0][0]
|
|
args = @child_process.exec.args[0][0]
|
|
@@ -63,7 +59,7 @@ describe "FileConverter", ->
|
|
|
done()
|
|
done()
|
|
|
|
|
|
|
|
describe "preview", ->
|
|
describe "preview", ->
|
|
|
- it "should call easy image resize with args", (done)->
|
|
|
|
|
|
|
+ it "should call converter resize with args", (done)->
|
|
|
@child_process.exec.callsArgWith(2)
|
|
@child_process.exec.callsArgWith(2)
|
|
|
@converter.preview @sourcePath, (err)=>
|
|
@converter.preview @sourcePath, (err)=>
|
|
|
args = @child_process.exec.args[0][0]
|
|
args = @child_process.exec.args[0][0]
|