diff --git a/test/integration/client/simple-query-tests.js b/test/integration/client/simple-query-tests.js index a8006d54..59972584 100644 --- a/test/integration/client/simple-query-tests.js +++ b/test/integration/client/simple-query-tests.js @@ -1,16 +1,26 @@ var helper = require(__dirname+"/test-helper"); //before running this test make sure you run the script create-test-tables -test("selects rows", function() { +test("simple query interface", function() { + var client = helper.client(); - var query = client.query("select * from person"); - var rowCount = 0; + var query = client.query("select name from person"); + + var rows = []; query.on('row', function(row) { - rowCount++; + rows.push(row.fields[0]) }); + assert.raises(query, 'end', function() { - assert.equal(rowCount, 26); + test("returned right number of rows", function() { + assert.length(rows, 26); + }); + test("row ordering", function(){ + assert.equal(rows[0], "Aaron"); + assert.equal(rows[25], "Zanzabar"); + }); client.end(); }); }); +