2010-11-11 11:45:39 +08:00
|
|
|
require(__dirname + '/test-helper');
|
|
|
|
|
2014-06-16 05:33:23 +08:00
|
|
|
/*
|
|
|
|
* Perhaps duplicate of test named 'initializing from a config string' in
|
|
|
|
* configuration-tests.js
|
|
|
|
*/
|
|
|
|
|
2010-11-11 11:45:39 +08:00
|
|
|
test("using connection string in client constructor", function() {
|
|
|
|
var client = new Client("postgres://brian:pw@boom:381/lala");
|
2014-06-16 05:33:23 +08:00
|
|
|
|
2010-11-11 11:45:39 +08:00
|
|
|
test("parses user", function() {
|
|
|
|
assert.equal(client.user,'brian');
|
2014-06-16 05:33:23 +08:00
|
|
|
});
|
2010-11-11 11:45:39 +08:00
|
|
|
test("parses password", function() {
|
|
|
|
assert.equal(client.password, 'pw');
|
2014-06-16 05:33:23 +08:00
|
|
|
});
|
2010-11-11 11:45:39 +08:00
|
|
|
test("parses host", function() {
|
|
|
|
assert.equal(client.host, 'boom');
|
2014-06-16 05:33:23 +08:00
|
|
|
});
|
2010-11-11 11:45:39 +08:00
|
|
|
test('parses port', function() {
|
|
|
|
assert.equal(client.port, 381)
|
2014-06-16 05:33:23 +08:00
|
|
|
});
|
2010-11-11 11:45:39 +08:00
|
|
|
test('parses database', function() {
|
|
|
|
assert.equal(client.database, 'lala')
|
2014-06-16 05:33:23 +08:00
|
|
|
});
|
|
|
|
});
|
2010-11-11 11:45:39 +08:00
|
|
|
|