2013-11-20 06:43:55 +04:00
|
|
|
/*globals describe, beforeEach, it*/
|
|
|
|
var net = require('net'),
|
|
|
|
assert = require('assert'),
|
|
|
|
should = require('should'),
|
|
|
|
request = require('request'),
|
|
|
|
server = require('../../server'),
|
2013-12-06 18:13:15 +04:00
|
|
|
config = require('../../../config');
|
2013-11-20 06:43:55 +04:00
|
|
|
|
|
|
|
describe('Server', function () {
|
2013-11-28 16:33:02 +04:00
|
|
|
var port = config.testing.server.port,
|
|
|
|
host = config.testing.server.host,
|
2013-11-20 06:43:55 +04:00
|
|
|
url = 'http://' + host + ':' + port;
|
|
|
|
|
|
|
|
|
|
|
|
it('should not start a connect server when required', function (done) {
|
|
|
|
request(url, function (error, response, body) {
|
|
|
|
assert.equal(response, undefined);
|
|
|
|
assert.equal(body, undefined);
|
|
|
|
assert.notEqual(error, undefined);
|
|
|
|
assert.equal(error.code, 'ECONNREFUSED');
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|