2014-02-04 21:30:26 +00:00
|
|
|
// Generated by CoffeeScript 1.6.3
|
|
|
|
|
(function() {
|
|
|
|
|
var path,
|
|
|
|
|
_this = this;
|
|
|
|
|
|
|
|
|
|
path = require('path');
|
|
|
|
|
|
|
|
|
|
exports.setUp = function(cb) {
|
|
|
|
|
_this.conf = require(path.join('..', 'js-coffee', 'config'));
|
|
|
|
|
_this.conf({
|
|
|
|
|
logType: 2
|
|
|
|
|
});
|
|
|
|
|
return cb();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
exports.testRequire = function(test) {
|
|
|
|
|
test.expect(1);
|
|
|
|
|
test.ok(_this.conf.isReady(), 'File does not exist!');
|
|
|
|
|
return test.done();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
exports.testParameters = function(test) {
|
|
|
|
|
test.expect(4);
|
|
|
|
|
test.ok(_this.conf.getHttpPort(), 'HTTP port does not exist!');
|
|
|
|
|
test.ok(_this.conf.getDBPort(), 'DB port does not exist!');
|
|
|
|
|
test.ok(_this.conf.getCryptoKey(), 'Crypto key does not exist!');
|
|
|
|
|
test.ok(_this.conf.getSessionSecret(), 'Session Secret does not exist!');
|
|
|
|
|
return test.done();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
exports.testDifferentConfigFile = function(test) {
|
|
|
|
|
test.expect(1);
|
|
|
|
|
_this.conf({
|
2014-02-10 21:28:10 +00:00
|
|
|
configPath: path.join('testing', 'files', 'jsonWrongConfig.json')
|
2014-02-04 21:30:26 +00:00
|
|
|
});
|
|
|
|
|
test.ok(_this.conf.isReady(), 'Different path not loaded!');
|
|
|
|
|
return test.done();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
exports.testNoConfigFile = function(test) {
|
|
|
|
|
test.expect(1);
|
|
|
|
|
_this.conf({
|
|
|
|
|
configPath: 'wrongpath.file'
|
|
|
|
|
});
|
|
|
|
|
test.strictEqual(_this.conf.isReady(), false, 'Wrong path still loaded!');
|
|
|
|
|
return test.done();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}).call(this);
|