afterEach(function() { if (fs.createWriteStream.restore) { fs.createWriteStream.restore(); } if (fs.createReadStream.restore) { fs.createReadStream.restore(); } });
it('can output to a writable stream from a string argument', function () { var fakeStream = {}; sinon.stub(fs, 'createWriteStream').returns(fakeStream); var stream = this.stream = mocha({output: 'result.log'}); stream.end(); fs.createWriteStream.should.be.calledWith('result.log'); fs.createWriteStream.restore(); this.childOut.pipe.should.be.calledWith(fakeStream); this.childErr.pipe.should.be.calledWith(fakeStream); });
afterEach(function() { http.get.restore(); fs.createWriteStream.restore(); });