From d7894c4ea73bb1410c2c99f7870819fd625da76e Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Fri, 26 Sep 2014 17:57:15 +0100 Subject: [PATCH] fixed tests --- .../document-updater/test/unit/coffee/AddingDocsToMemory.coffee | 2 +- .../test/unit/coffee/CheckingUpdatesLength.coffee | 2 +- .../unit/coffee/DispatchManager/DispatchManagerTests.coffee | 2 +- services/document-updater/test/unit/coffee/GettingDoc.coffee | 2 +- .../test/unit/coffee/GettingListOfPendingUpdates.coffee | 2 +- .../test/unit/coffee/GettingTotalNumberOfDocs.coffee | 2 +- .../test/unit/coffee/LockManager/CheckingTheLock.coffee | 2 +- .../test/unit/coffee/LockManager/ReleasingTheLock.coffee | 2 +- .../test/unit/coffee/LockManager/getLockTests.coffee | 2 +- .../test/unit/coffee/LockManager/tryLockTests.coffee | 2 +- .../RedisManager/clearDocFromPendingUpdatesSetTests.coffee | 2 +- .../coffee/RedisManager/getDocsWithPendingUpdatesTests.coffee | 2 +- .../coffee/RedisManager/getPendingUpdatesForDocTests.coffee | 2 +- .../test/unit/coffee/RedisManager/getPreviousDocOpsTests.coffee | 2 +- .../test/unit/coffee/RedisManager/pushDocOpTests.coffee | 2 +- .../coffee/RedisManager/pushUncompressedHistoryOpTests.coffee | 2 +- .../test/unit/coffee/ShareJsUpdateManagerTests.coffee | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/services/document-updater/test/unit/coffee/AddingDocsToMemory.coffee b/services/document-updater/test/unit/coffee/AddingDocsToMemory.coffee index ffed682321..328eb13b8c 100644 --- a/services/document-updater/test/unit/coffee/AddingDocsToMemory.coffee +++ b/services/document-updater/test/unit/coffee/AddingDocsToMemory.coffee @@ -22,7 +22,7 @@ describe 'putting a doc into memory', ()-> mocks = "logger-sharelatex": log:-> - redis: + "redis-sharelatex": createClient : ()-> auth:-> multi: ()-> diff --git a/services/document-updater/test/unit/coffee/CheckingUpdatesLength.coffee b/services/document-updater/test/unit/coffee/CheckingUpdatesLength.coffee index 4f76c48ae7..de04724fef 100644 --- a/services/document-updater/test/unit/coffee/CheckingUpdatesLength.coffee +++ b/services/document-updater/test/unit/coffee/CheckingUpdatesLength.coffee @@ -13,7 +13,7 @@ describe 'Document Manager - getUpdatesLength ', -> @llenStub = sinon.stub() @redisManager = SandboxedModule.require modulePath, requires: - redis: + "redis-sharelatex": createClient:=> auth:-> llen:@llenStub diff --git a/services/document-updater/test/unit/coffee/DispatchManager/DispatchManagerTests.coffee b/services/document-updater/test/unit/coffee/DispatchManager/DispatchManagerTests.coffee index 3d4be1cfec..2b38b8f077 100644 --- a/services/document-updater/test/unit/coffee/DispatchManager/DispatchManagerTests.coffee +++ b/services/document-updater/test/unit/coffee/DispatchManager/DispatchManagerTests.coffee @@ -12,7 +12,7 @@ describe "DispatchManager", -> "settings-sharelatex": @settings = redis: web: {} - "redis": @redis = {} + "redis-sharelatex": @redis = {} @callback = sinon.stub() describe "each worker", -> diff --git a/services/document-updater/test/unit/coffee/GettingDoc.coffee b/services/document-updater/test/unit/coffee/GettingDoc.coffee index 824fe14a3f..6796f4c8bb 100644 --- a/services/document-updater/test/unit/coffee/GettingDoc.coffee +++ b/services/document-updater/test/unit/coffee/GettingDoc.coffee @@ -11,7 +11,7 @@ describe 'RedisManager - getDoc', -> @rclient.multi = () => @rclient @RedisManager = SandboxedModule.require modulePath, requires: - "redis": @redis = + "redis-sharelatex": @redis = createClient: () => @rclient @doc_id = "doc-id-123" diff --git a/services/document-updater/test/unit/coffee/GettingListOfPendingUpdates.coffee b/services/document-updater/test/unit/coffee/GettingListOfPendingUpdates.coffee index 14f81f6052..10d1c39038 100644 --- a/services/document-updater/test/unit/coffee/GettingListOfPendingUpdates.coffee +++ b/services/document-updater/test/unit/coffee/GettingListOfPendingUpdates.coffee @@ -18,7 +18,7 @@ describe 'getting entire list of pending updates', ()-> redisReturn = [] mocks = - redis: + "redis-sharelatex": createClient: ()-> auth:-> multi: ()-> diff --git a/services/document-updater/test/unit/coffee/GettingTotalNumberOfDocs.coffee b/services/document-updater/test/unit/coffee/GettingTotalNumberOfDocs.coffee index 3b4f449f94..bac04361c3 100644 --- a/services/document-updater/test/unit/coffee/GettingTotalNumberOfDocs.coffee +++ b/services/document-updater/test/unit/coffee/GettingTotalNumberOfDocs.coffee @@ -19,7 +19,7 @@ describe 'getting cound of docs from memory', ()-> beforeEach (done)-> mocks = "logger-sharelatex": log:-> - redis: + "redis-sharelatex": createClient : ()-> auth:-> smembers:(key, callback)-> diff --git a/services/document-updater/test/unit/coffee/LockManager/CheckingTheLock.coffee b/services/document-updater/test/unit/coffee/LockManager/CheckingTheLock.coffee index fe744d2379..598c4903c2 100644 --- a/services/document-updater/test/unit/coffee/LockManager/CheckingTheLock.coffee +++ b/services/document-updater/test/unit/coffee/LockManager/CheckingTheLock.coffee @@ -19,7 +19,7 @@ describe 'Lock Manager - checking the lock', ()-> mocks = "logger-sharelatex": log:-> - redis: + "redis-sharelatex": createClient : ()-> auth:-> multi: -> diff --git a/services/document-updater/test/unit/coffee/LockManager/ReleasingTheLock.coffee b/services/document-updater/test/unit/coffee/LockManager/ReleasingTheLock.coffee index 39f16b09b9..4ae75e7719 100644 --- a/services/document-updater/test/unit/coffee/LockManager/ReleasingTheLock.coffee +++ b/services/document-updater/test/unit/coffee/LockManager/ReleasingTheLock.coffee @@ -14,7 +14,7 @@ describe 'LockManager - releasing the lock', ()-> mocks = "logger-sharelatex": log:-> - redis: + "redis-sharelatex": createClient : ()-> auth:-> del:deleteStub diff --git a/services/document-updater/test/unit/coffee/LockManager/getLockTests.coffee b/services/document-updater/test/unit/coffee/LockManager/getLockTests.coffee index f378650d95..ee88dfb2db 100644 --- a/services/document-updater/test/unit/coffee/LockManager/getLockTests.coffee +++ b/services/document-updater/test/unit/coffee/LockManager/getLockTests.coffee @@ -8,7 +8,7 @@ describe 'LockManager - getting the lock', -> beforeEach -> @LockManager = SandboxedModule.require modulePath, requires: "logger-sharelatex": log:-> - redis: + "redis-sharelatex": createClient : () => auth:-> @callback = sinon.stub() diff --git a/services/document-updater/test/unit/coffee/LockManager/tryLockTests.coffee b/services/document-updater/test/unit/coffee/LockManager/tryLockTests.coffee index 6c2c8972af..c828399c12 100644 --- a/services/document-updater/test/unit/coffee/LockManager/tryLockTests.coffee +++ b/services/document-updater/test/unit/coffee/LockManager/tryLockTests.coffee @@ -8,7 +8,7 @@ describe 'LockManager - trying the lock', -> beforeEach -> @LockManager = SandboxedModule.require modulePath, requires: "logger-sharelatex": log:-> - redis: + "redis-sharelatex": createClient : () => auth:-> set: @set = sinon.stub() diff --git a/services/document-updater/test/unit/coffee/RedisManager/clearDocFromPendingUpdatesSetTests.coffee b/services/document-updater/test/unit/coffee/RedisManager/clearDocFromPendingUpdatesSetTests.coffee index 016d96a2ae..81eb0bfefe 100644 --- a/services/document-updater/test/unit/coffee/RedisManager/clearDocFromPendingUpdatesSetTests.coffee +++ b/services/document-updater/test/unit/coffee/RedisManager/clearDocFromPendingUpdatesSetTests.coffee @@ -10,7 +10,7 @@ describe "RedisManager.clearDocFromPendingUpdatesSet", -> @doc_id = "document-id" @callback = sinon.stub() @RedisManager = SandboxedModule.require modulePath, requires: - "redis" : createClient: () => + "redis-sharelatex" : createClient: () => @rclient = auth:-> "logger-sharelatex": {} diff --git a/services/document-updater/test/unit/coffee/RedisManager/getDocsWithPendingUpdatesTests.coffee b/services/document-updater/test/unit/coffee/RedisManager/getDocsWithPendingUpdatesTests.coffee index d179b45f9d..5bbb93a723 100644 --- a/services/document-updater/test/unit/coffee/RedisManager/getDocsWithPendingUpdatesTests.coffee +++ b/services/document-updater/test/unit/coffee/RedisManager/getDocsWithPendingUpdatesTests.coffee @@ -8,7 +8,7 @@ describe "RedisManager.getDocsWithPendingUpdates", -> beforeEach -> @callback = sinon.stub() @RedisManager = SandboxedModule.require modulePath, requires: - "redis" : createClient: () => + "redis-sharelatex" : createClient: () => @rclient = auth:-> "logger-sharelatex": {} diff --git a/services/document-updater/test/unit/coffee/RedisManager/getPendingUpdatesForDocTests.coffee b/services/document-updater/test/unit/coffee/RedisManager/getPendingUpdatesForDocTests.coffee index 4910f1498f..9c70033eb4 100644 --- a/services/document-updater/test/unit/coffee/RedisManager/getPendingUpdatesForDocTests.coffee +++ b/services/document-updater/test/unit/coffee/RedisManager/getPendingUpdatesForDocTests.coffee @@ -7,7 +7,7 @@ SandboxedModule = require('sandboxed-module') describe "RedisManager.getPendingUpdatesForDoc", -> beforeEach -> @RedisManager = SandboxedModule.require modulePath, requires: - "redis": createClient: () => + "redis-sharelatex": createClient: () => @rclient = auth: () -> multi: () => @rclient diff --git a/services/document-updater/test/unit/coffee/RedisManager/getPreviousDocOpsTests.coffee b/services/document-updater/test/unit/coffee/RedisManager/getPreviousDocOpsTests.coffee index 775418313e..6cd4980fd8 100644 --- a/services/document-updater/test/unit/coffee/RedisManager/getPreviousDocOpsTests.coffee +++ b/services/document-updater/test/unit/coffee/RedisManager/getPreviousDocOpsTests.coffee @@ -8,7 +8,7 @@ describe "RedisManager.getPreviousDocOpsTests", -> beforeEach -> @callback = sinon.stub() @RedisManager = SandboxedModule.require modulePath, requires: - "redis" : createClient: () => + "redis-sharelatex" : createClient: () => @rclient = auth: -> multi: => @rclient diff --git a/services/document-updater/test/unit/coffee/RedisManager/pushDocOpTests.coffee b/services/document-updater/test/unit/coffee/RedisManager/pushDocOpTests.coffee index 247862a257..71a36bb4f3 100644 --- a/services/document-updater/test/unit/coffee/RedisManager/pushDocOpTests.coffee +++ b/services/document-updater/test/unit/coffee/RedisManager/pushDocOpTests.coffee @@ -7,7 +7,7 @@ SandboxedModule = require('sandboxed-module') describe "RedisManager.pushDocOp", -> beforeEach -> @RedisManager = SandboxedModule.require modulePath, requires: - "redis": createClient: () => + "redis-sharelatex": createClient: () => @rclient = auth: () -> multi: () => @rclient diff --git a/services/document-updater/test/unit/coffee/RedisManager/pushUncompressedHistoryOpTests.coffee b/services/document-updater/test/unit/coffee/RedisManager/pushUncompressedHistoryOpTests.coffee index d6e19f163e..621a3b1a3b 100644 --- a/services/document-updater/test/unit/coffee/RedisManager/pushUncompressedHistoryOpTests.coffee +++ b/services/document-updater/test/unit/coffee/RedisManager/pushUncompressedHistoryOpTests.coffee @@ -7,7 +7,7 @@ SandboxedModule = require('sandboxed-module') describe "RedisManager.pushUncompressedHistoryOp", -> beforeEach -> @RedisManager = SandboxedModule.require modulePath, requires: - "redis": createClient: () => + "redis-sharelatex": createClient: () => @rclient = auth: () -> multi: () => @rclient diff --git a/services/document-updater/test/unit/coffee/ShareJsUpdateManagerTests.coffee b/services/document-updater/test/unit/coffee/ShareJsUpdateManagerTests.coffee index 20e737fc97..ecccc91a7e 100644 --- a/services/document-updater/test/unit/coffee/ShareJsUpdateManagerTests.coffee +++ b/services/document-updater/test/unit/coffee/ShareJsUpdateManagerTests.coffee @@ -15,7 +15,7 @@ describe "ShareJsUpdateManager", -> class Model constructor: (@db) -> "./ShareJsDB" : @ShareJsDB = { mockDB: true } - "redis" : createClient: () => @rclient = auth:-> + "redis-sharelatex" : createClient: () => @rclient = auth:-> "logger-sharelatex": @logger = { log: sinon.stub() } globals: clearTimeout: @clearTimeout = sinon.stub()