fixed tests

This commit is contained in:
Henry Oswald 2014-09-26 17:57:15 +01:00
parent 672dd3de1b
commit d7894c4ea7
17 changed files with 17 additions and 17 deletions

View file

@ -22,7 +22,7 @@ describe 'putting a doc into memory', ()->
mocks = mocks =
"logger-sharelatex": log:-> "logger-sharelatex": log:->
redis: "redis-sharelatex":
createClient : ()-> createClient : ()->
auth:-> auth:->
multi: ()-> multi: ()->

View file

@ -13,7 +13,7 @@ describe 'Document Manager - getUpdatesLength ', ->
@llenStub = sinon.stub() @llenStub = sinon.stub()
@redisManager = SandboxedModule.require modulePath, requires: @redisManager = SandboxedModule.require modulePath, requires:
redis: "redis-sharelatex":
createClient:=> createClient:=>
auth:-> auth:->
llen:@llenStub llen:@llenStub

View file

@ -12,7 +12,7 @@ describe "DispatchManager", ->
"settings-sharelatex": @settings = "settings-sharelatex": @settings =
redis: redis:
web: {} web: {}
"redis": @redis = {} "redis-sharelatex": @redis = {}
@callback = sinon.stub() @callback = sinon.stub()
describe "each worker", -> describe "each worker", ->

View file

@ -11,7 +11,7 @@ describe 'RedisManager - getDoc', ->
@rclient.multi = () => @rclient @rclient.multi = () => @rclient
@RedisManager = SandboxedModule.require modulePath, requires: @RedisManager = SandboxedModule.require modulePath, requires:
"redis": @redis = "redis-sharelatex": @redis =
createClient: () => @rclient createClient: () => @rclient
@doc_id = "doc-id-123" @doc_id = "doc-id-123"

View file

@ -18,7 +18,7 @@ describe 'getting entire list of pending updates', ()->
redisReturn = [] redisReturn = []
mocks = mocks =
redis: "redis-sharelatex":
createClient: ()-> createClient: ()->
auth:-> auth:->
multi: ()-> multi: ()->

View file

@ -19,7 +19,7 @@ describe 'getting cound of docs from memory', ()->
beforeEach (done)-> beforeEach (done)->
mocks = mocks =
"logger-sharelatex": log:-> "logger-sharelatex": log:->
redis: "redis-sharelatex":
createClient : ()-> createClient : ()->
auth:-> auth:->
smembers:(key, callback)-> smembers:(key, callback)->

View file

@ -19,7 +19,7 @@ describe 'Lock Manager - checking the lock', ()->
mocks = mocks =
"logger-sharelatex": log:-> "logger-sharelatex": log:->
redis: "redis-sharelatex":
createClient : ()-> createClient : ()->
auth:-> auth:->
multi: -> multi: ->

View file

@ -14,7 +14,7 @@ describe 'LockManager - releasing the lock', ()->
mocks = mocks =
"logger-sharelatex": log:-> "logger-sharelatex": log:->
redis: "redis-sharelatex":
createClient : ()-> createClient : ()->
auth:-> auth:->
del:deleteStub del:deleteStub

View file

@ -8,7 +8,7 @@ describe 'LockManager - getting the lock', ->
beforeEach -> beforeEach ->
@LockManager = SandboxedModule.require modulePath, requires: @LockManager = SandboxedModule.require modulePath, requires:
"logger-sharelatex": log:-> "logger-sharelatex": log:->
redis: "redis-sharelatex":
createClient : () => createClient : () =>
auth:-> auth:->
@callback = sinon.stub() @callback = sinon.stub()

View file

@ -8,7 +8,7 @@ describe 'LockManager - trying the lock', ->
beforeEach -> beforeEach ->
@LockManager = SandboxedModule.require modulePath, requires: @LockManager = SandboxedModule.require modulePath, requires:
"logger-sharelatex": log:-> "logger-sharelatex": log:->
redis: "redis-sharelatex":
createClient : () => createClient : () =>
auth:-> auth:->
set: @set = sinon.stub() set: @set = sinon.stub()

View file

@ -10,7 +10,7 @@ describe "RedisManager.clearDocFromPendingUpdatesSet", ->
@doc_id = "document-id" @doc_id = "document-id"
@callback = sinon.stub() @callback = sinon.stub()
@RedisManager = SandboxedModule.require modulePath, requires: @RedisManager = SandboxedModule.require modulePath, requires:
"redis" : createClient: () => "redis-sharelatex" : createClient: () =>
@rclient = auth:-> @rclient = auth:->
"logger-sharelatex": {} "logger-sharelatex": {}

View file

@ -8,7 +8,7 @@ describe "RedisManager.getDocsWithPendingUpdates", ->
beforeEach -> beforeEach ->
@callback = sinon.stub() @callback = sinon.stub()
@RedisManager = SandboxedModule.require modulePath, requires: @RedisManager = SandboxedModule.require modulePath, requires:
"redis" : createClient: () => "redis-sharelatex" : createClient: () =>
@rclient = auth:-> @rclient = auth:->
"logger-sharelatex": {} "logger-sharelatex": {}

View file

@ -7,7 +7,7 @@ SandboxedModule = require('sandboxed-module')
describe "RedisManager.getPendingUpdatesForDoc", -> describe "RedisManager.getPendingUpdatesForDoc", ->
beforeEach -> beforeEach ->
@RedisManager = SandboxedModule.require modulePath, requires: @RedisManager = SandboxedModule.require modulePath, requires:
"redis": createClient: () => "redis-sharelatex": createClient: () =>
@rclient = @rclient =
auth: () -> auth: () ->
multi: () => @rclient multi: () => @rclient

View file

@ -8,7 +8,7 @@ describe "RedisManager.getPreviousDocOpsTests", ->
beforeEach -> beforeEach ->
@callback = sinon.stub() @callback = sinon.stub()
@RedisManager = SandboxedModule.require modulePath, requires: @RedisManager = SandboxedModule.require modulePath, requires:
"redis" : createClient: () => "redis-sharelatex" : createClient: () =>
@rclient = @rclient =
auth: -> auth: ->
multi: => @rclient multi: => @rclient

View file

@ -7,7 +7,7 @@ SandboxedModule = require('sandboxed-module')
describe "RedisManager.pushDocOp", -> describe "RedisManager.pushDocOp", ->
beforeEach -> beforeEach ->
@RedisManager = SandboxedModule.require modulePath, requires: @RedisManager = SandboxedModule.require modulePath, requires:
"redis": createClient: () => "redis-sharelatex": createClient: () =>
@rclient = @rclient =
auth: () -> auth: () ->
multi: () => @rclient multi: () => @rclient

View file

@ -7,7 +7,7 @@ SandboxedModule = require('sandboxed-module')
describe "RedisManager.pushUncompressedHistoryOp", -> describe "RedisManager.pushUncompressedHistoryOp", ->
beforeEach -> beforeEach ->
@RedisManager = SandboxedModule.require modulePath, requires: @RedisManager = SandboxedModule.require modulePath, requires:
"redis": createClient: () => "redis-sharelatex": createClient: () =>
@rclient = @rclient =
auth: () -> auth: () ->
multi: () => @rclient multi: () => @rclient

View file

@ -15,7 +15,7 @@ describe "ShareJsUpdateManager", ->
class Model class Model
constructor: (@db) -> constructor: (@db) ->
"./ShareJsDB" : @ShareJsDB = { mockDB: true } "./ShareJsDB" : @ShareJsDB = { mockDB: true }
"redis" : createClient: () => @rclient = auth:-> "redis-sharelatex" : createClient: () => @rclient = auth:->
"logger-sharelatex": @logger = { log: sinon.stub() } "logger-sharelatex": @logger = { log: sinon.stub() }
globals: globals:
clearTimeout: @clearTimeout = sinon.stub() clearTimeout: @clearTimeout = sinon.stub()