update tests
This commit is contained in:
@@ -202,8 +202,8 @@ describe "CompileManager", ->
|
|||||||
|
|
||||||
describe "wordcount", ->
|
describe "wordcount", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@CommandRunner.run = sinon.stub().callsArg(5)
|
@CommandRunner.run = sinon.stub().callsArg(6)
|
||||||
@fs.readFileSync = sinon.stub().returns @stdout = "Encoding: ascii\nWords in text: 2"
|
@fs.readFile = sinon.stub().callsArgWith(2, null, @stdout = "Encoding: ascii\nWords in text: 2")
|
||||||
@callback = sinon.stub()
|
@callback = sinon.stub()
|
||||||
|
|
||||||
@project_id = "project-id-123"
|
@project_id = "project-id-123"
|
||||||
@@ -217,10 +217,10 @@ describe "CompileManager", ->
|
|||||||
it "should run the texcount command", ->
|
it "should run the texcount command", ->
|
||||||
@directory = "#{@Settings.path.compilesDir}/#{@project_id}-#{@user_id}"
|
@directory = "#{@Settings.path.compilesDir}/#{@project_id}-#{@user_id}"
|
||||||
@file_path = "$COMPILE_DIR/#{@file_name}"
|
@file_path = "$COMPILE_DIR/#{@file_name}"
|
||||||
@command =[ "texcount", "-inc", @file_path, "-out=" + @file_path + ".wc"]
|
@command =[ "texcount", "-nocol", "-inc", @file_path, "-out=" + @file_path + ".wc"]
|
||||||
|
|
||||||
@CommandRunner.run
|
@CommandRunner.run
|
||||||
.calledWith("#{@project_id}-#{@user_id}", @command, @directory, @image, @timeout)
|
.calledWith("#{@project_id}-#{@user_id}", @command, @directory, @image, @timeout, {})
|
||||||
.should.equal true
|
.should.equal true
|
||||||
|
|
||||||
it "should call the callback with the parsed output", ->
|
it "should call the callback with the parsed output", ->
|
||||||
@@ -234,5 +234,7 @@ describe "CompileManager", ->
|
|||||||
elements: 0
|
elements: 0
|
||||||
mathInline: 0
|
mathInline: 0
|
||||||
mathDisplay: 0
|
mathDisplay: 0
|
||||||
|
errors: 0
|
||||||
|
messages: ""
|
||||||
})
|
})
|
||||||
.should.equal true
|
.should.equal true
|
||||||
|
|||||||
Reference in New Issue
Block a user