2014-02-04 07:35:07 +00:00
|
|
|
exports.setUp = ( cb ) =>
|
|
|
|
|
@conf = require '../js-coffee/config'
|
|
|
|
|
@conf
|
|
|
|
|
logType: 2
|
|
|
|
|
cb()
|
|
|
|
|
|
|
|
|
|
exports.testRequire = ( test ) =>
|
|
|
|
|
test.expect 1
|
|
|
|
|
test.ok @conf.isReady(), 'File does not exist!'
|
2014-01-13 14:23:06 +00:00
|
|
|
test.done()
|
|
|
|
|
|
2014-02-04 07:35:07 +00:00
|
|
|
exports.testParameters = ( test ) =>
|
|
|
|
|
test.expect 4
|
|
|
|
|
test.ok @conf.getHttpPort(), 'HTTP port does not exist!'
|
|
|
|
|
test.ok @conf.getDBPort(), 'DB port does not exist!'
|
|
|
|
|
test.ok @conf.getCryptoKey(), 'Crypto key does not exist!'
|
|
|
|
|
test.ok @conf.getSessionSecret(), 'Session Secret does not exist!'
|
|
|
|
|
test.done()
|
2014-01-13 14:23:06 +00:00
|
|
|
|
2014-02-04 07:35:07 +00:00
|
|
|
exports.testDifferentConfigFile = ( test ) =>
|
|
|
|
|
test.expect 1
|
|
|
|
|
@conf
|
|
|
|
|
configPath: 'testing/jsonWrongConfig.json'
|
|
|
|
|
test.ok @conf.isReady(), 'Different path not loaded!'
|
|
|
|
|
test.done()
|
2014-01-13 14:23:06 +00:00
|
|
|
|
2014-02-04 07:35:07 +00:00
|
|
|
exports.testNoConfigFile = ( test ) =>
|
|
|
|
|
test.expect 1
|
|
|
|
|
@conf
|
|
|
|
|
configPath: 'wrongpath.file'
|
|
|
|
|
test.strictEqual @conf.isReady(), false, 'Wrong path still loaded!'
|
|
|
|
|
test.done()
|