 					.should.equal true
 
 		describe "with error", ->
-			beforeEach ->
+			beforeEach (done)->
+				@UrlFetcher.pipeUrlToFile @url, @path, (err)=>
+					@callback(err)
+					done()
 				@urlStream.emit "error", @error = new Error("something went wrong")
 
 			it "should call the callback with the error", ->

				@callback.called.should.equal true

		describe "with non success status code", ->
			beforeEach ->
				@res = statusCode: 404
				@urlStream.emit "response", @res
				@urlStream.emit "end"

		@defaults.calledWith(jar: false)
			.should.equal true
		
	describe "pipeUrlToFile", ->
		beforeEach (done)->
			@path = "/path/to/file/on/disk"
			@request.get = sinon.stub().returns(@urlStream = new EventEmitter)
			@urlStream.pipe = sinon.stub()
