Skip to content

Commit

Permalink
Merge pull request #316 from Palid/master
Browse files Browse the repository at this point in the history
Rember to add path.resolve while requiring things!
  • Loading branch information
Chris Nehren committed Feb 8, 2015
2 parents dc6284d + 673d1e0 commit e4bad27
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/helpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Mock irc server */

var path = require('path');
var fs = require('fs');
var net = require('net');
var tls = require('tls');
Expand All @@ -14,8 +15,8 @@ var MockIrcd = function(port, encoding, isSecure) {
if (isSecure) {
connectionClass = tls;
options = {
key: fs.readFileSync('test/data/ircd.key'),
cert: fs.readFileSync('test/data/ircd.pem')
key: fs.readFileSync(path.resolve(__dirname, 'data/ircd.key')),
cert: fs.readFileSync(path.resolve(__dirname, 'data/ircd.pem'))
};
} else {
connectionClass = net;
Expand All @@ -38,7 +39,7 @@ var MockIrcd = function(port, encoding, isSecure) {
});

c.on('end', function() {
self.emit('end')
self.emit('end');
});
});

Expand All @@ -61,7 +62,7 @@ MockIrcd.prototype.getIncomingMsgs = function() {
var fixtures = require('./data/fixtures');
module.exports.getFixtures = function(testSuite) {
return fixtures[testSuite];
}
};

module.exports.MockIrcd = function(port, encoding, isSecure) {
return new MockIrcd(port, encoding, isSecure);
Expand Down

0 comments on commit e4bad27

Please sign in to comment.