From fa416b470ac4fb2e5f880dacf52e5fbccee9d932 Mon Sep 17 00:00:00 2001 From: brianc Date: Tue, 22 Feb 2011 22:20:47 -0600 Subject: [PATCH] connection tests pass --- test/libpq/binding-spike.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/libpq/binding-spike.js b/test/libpq/binding-spike.js index 4feb8665..8c718565 100644 --- a/test/libpq/binding-spike.js +++ b/test/libpq/binding-spike.js @@ -16,7 +16,8 @@ test('connecting with wrong parameters', function() { var con = new Connection(); con.connect("user=asldfkj hostaddr=127.0.0.1 port=5432 dbname=asldkfj"); assert.emits(con, 'error', function(error) { - console.log(error); + assert.ok(error != null, "error should not be null"); + con.end(); }); }); @@ -25,12 +26,10 @@ test('connects', function() { var con = new Connection(); con.connect("user=brian hostaddr=127.0.0.1 port=5432 dbname=postgres"); assert.emits(con, 'connect', function() { - con._sendQuery("SELECT NOW()"); - assert.emits(con, 'row', function(row) { - assert.ok(false, "Need to assert on row data"); - test('ends connection', function() { + test('disconnects', function() { + assert.emits(con, 'connect', function() { con.end(); - }); - }); - }); + }) + }) + }) })