2014-02-04 15:40:32 +00:00
|
|
|
path = require 'path'
|
|
|
|
|
|
2014-02-04 07:35:07 +00:00
|
|
|
exports.setUp = ( cb ) =>
|
2014-02-04 15:40:32 +00:00
|
|
|
@conf = require path.join '..', 'js-coffee', 'config'
|
|
|
|
|
@conf
|
|
|
|
|
logType: 2
|
|
|
|
|
cb()
|
2014-02-04 07:35:07 +00:00
|
|
|
|
|
|
|
|
exports.testRequire = ( test ) =>
|
2014-02-04 15:40:32 +00:00
|
|
|
test.expect 1
|
|
|
|
|
test.ok @conf.isReady(), 'File does not exist!'
|
|
|
|
|
test.done()
|
2014-01-13 14:23:06 +00:00
|
|
|
|
2014-02-04 07:35:07 +00:00
|
|
|
exports.testParameters = ( test ) =>
|
2014-02-04 15:40:32 +00:00
|
|
|
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 ) =>
|
2014-02-04 15:40:32 +00:00
|
|
|
test.expect 1
|
|
|
|
|
@conf
|
2014-02-10 21:28:10 +00:00
|
|
|
configPath: path.join 'testing', 'files', 'jsonWrongConfig.json'
|
2014-02-04 15:40:32 +00:00
|
|
|
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 ) =>
|
2014-02-04 15:40:32 +00:00
|
|
|
test.expect 1
|
|
|
|
|
@conf
|
|
|
|
|
configPath: 'wrongpath.file'
|
|
|
|
|
test.strictEqual @conf.isReady(), false, 'Wrong path still loaded!'
|
|
|
|
|
test.done()
|