.end(function(err, res) { expect(fs.createWriteStream.calledWithMatch( new RegExp(res.body.login+'\\.png') )).to.be.equal(true); done(); });
.end(function() { expect(fs.createWriteStream.calledWithMatch(/public\/avatars\/.*\.png/)).to.be.equal(true); done(); });