2011-08-12 08:32:57 +08:00
|
|
|
var helper = require(__dirname + '/test-helper');
|
|
|
|
|
|
|
|
//setup defaults
|
|
|
|
helper.pg.defaults.user = helper.args.user;
|
|
|
|
helper.pg.defaults.password = helper.args.password;
|
|
|
|
helper.pg.defaults.host = helper.args.host;
|
|
|
|
helper.pg.defaults.port = helper.args.port;
|
|
|
|
helper.pg.defaults.database = helper.args.database;
|
|
|
|
helper.pg.defaults.poolSize = 1;
|
|
|
|
|
2013-03-08 05:57:00 +08:00
|
|
|
helper.pg.connect(assert.calls(function(err, client, done) {
|
2011-08-12 08:32:57 +08:00
|
|
|
assert.isNull(err);
|
2013-02-21 06:08:48 +08:00
|
|
|
client.query('SELECT NOW()');
|
|
|
|
client.once('drain', function() {
|
|
|
|
setTimeout(function() {
|
|
|
|
helper.pg.end();
|
2013-03-08 05:57:00 +08:00
|
|
|
done();
|
2013-02-21 06:08:48 +08:00
|
|
|
|
|
|
|
}, 10);
|
|
|
|
});
|
2011-08-12 08:32:57 +08:00
|
|
|
}));
|