 			@json_ranges = JSON.stringify @ranges
 			@rclient.get = sinon.stub()
 			@rclient.exec = sinon.stub().callsArgWith(0, null, [@jsonlines, @version, @hash, @project_id, @json_ranges])
-			@rclient.sadd = sinon.stub().yields()
+			@rclient.sadd = sinon.stub().yields(null, 0)
 
 		describe "successfully", ->
 			beforeEach ->

			it 'should not log any errors', ->
				@logger.error.calledWith()
					.should.equal false

		describe "with a corrupted document", ->
			beforeEach ->

					.calledWith("Ranges:#{@doc_id}")
					.should.equal true

			it "should check if the document is in the DocsIn set", ->
				@rclient.sadd
					.calledWith("DocsIn:#{@project_id}")
					.should.equal true

			it 'should return the document', ->
				@callback
					.calledWith(null, @lines, @version, @ranges)
