 should = chai.should()
 modulePath = "../../../../app/js/ShareJsUpdateManager.js"
 SandboxedModule = require('sandboxed-module')
+crypto = require('crypto')
 
 describe "ShareJsUpdateManager", ->
 	beforeEach ->

			it "should call the callback with the error", ->
				@callback.calledWith(@error).should.equal true

	describe "_listenForOps", ->
		beforeEach ->
			@model = on: (event, callback) =>

		beforeEach ->
			@lines = ["one", "two"]
			@version = 34
			@updatedDocLines = ["onefoo", "two"]
			content = @updatedDocLines.join("\n")
			@hash = crypto.createHash('sha1').update("blob " + content.length + "\x00").update(content, 'utf8').digest('hex')
			@update = {p: 4, t: "foo", v:@version, hash:@hash}
			@model =
				applyOp: sinon.stub().callsArg(2)
				getSnapshot: sinon.stub()
