diff --git a/test/native/evented-api-tests.js b/test/native/evented-api-tests.js index e4d871f0..735647f1 100644 --- a/test/native/evented-api-tests.js +++ b/test/native/evented-api-tests.js @@ -1,8 +1,8 @@ var helper = require(__dirname + "/../test-helper"); var Client = require(__dirname + "/../../lib/native").Client; - +var conString = "tcp://postgres:1234@127.0.0.1:5432/postgres"; test('connects', function() { - var client = new Client("tcp://postgres:1234@127.0.0.1:5432/postgres"); + var client = new Client(conString); client.connect(); test('good query', function() { var query = client.query("SELECT 1 as num, 'HELLO' as str"); @@ -25,6 +25,22 @@ test('connects', function() { }) }) }) - }) +test('multiple results', function() { + var client = new Client(conString); + client.connect(); + test('queued queries', function() { + client.query("CREATE TEMP TABLE boom(name varchar(10))"); + client.query("INSERT INTO boom(name) VALUES('Aaron')"); + client.query("INSERT INTO boom(name) VALUES('Brian')"); + var q = client.query("SELECT * from BOOM"); + assert.emits(q, 'row', function(row) { + assert.equal(row.name, 'Aaron'); + assert.emits(q, 'row', function(row) { + assert.equal(row.name, "Brian"); + client.end(); + }) + }) + }) +})