2011-07-20 05:55:39 +08:00
|
|
|
var helper = require(__dirname+'/../test-helper');
|
2011-08-29 15:35:08 +08:00
|
|
|
var Connection = require(__dirname + '/../../../lib/connection');
|
2010-10-27 10:47:18 +08:00
|
|
|
var makeClient = function() {
|
|
|
|
var connection = new Connection({stream: "no"});
|
|
|
|
connection.startup = function() {};
|
|
|
|
connection.connect = function() {};
|
|
|
|
connection.query = function(text) {
|
|
|
|
this.queries.push(text);
|
|
|
|
};
|
|
|
|
connection.queries = [];
|
|
|
|
var client = new Client({connection: connection});
|
2011-09-21 23:15:34 +08:00
|
|
|
client.connect();
|
2010-10-27 10:47:18 +08:00
|
|
|
client.connection.emit('connect');
|
|
|
|
return client;
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
client: makeClient
|
|
|
|
};
|