2013-04-07 21:53:55 +00:00
|
|
|
module.exports = require('should');
|
|
|
|
|
2013-03-27 00:37:13 +00:00
|
|
|
var Schema = require('jugglingdb').Schema;
|
|
|
|
|
2013-06-13 16:34:31 +00:00
|
|
|
global.getConfig = function(options) {
|
|
|
|
|
|
|
|
var dbConf = {
|
2013-03-27 00:37:13 +00:00
|
|
|
database: 'myapp_test',
|
|
|
|
username: 'root'
|
2013-06-13 16:34:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (options) {
|
|
|
|
for (var el in options) {
|
|
|
|
dbConf[el] = options[el]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return dbConf;
|
|
|
|
}
|
|
|
|
|
|
|
|
global.getSchema = function(options) {
|
|
|
|
var db = new Schema(require('../'), getConfig(options));
|
2013-03-27 00:37:13 +00:00
|
|
|
return db;
|
|
|
|
};
|