 exports.row = (test) ->
 	row = query.row 'SELECT * FROM test_table WHERE id = 1'
 	test.deepEqual row, {id: 1, data: 'first'}, 'should return the first and only row from query'
-	
+
 	test.throws (->
 		query.row 'SELECT * FROM test_table'
 	), Error, 'should throw error if more than one row returned'
-	
+
 	test.throws (->
 		query.row 'SELECT * FROM test_table WHERE id = 3'
 	), Error, 'should throw error if no rows returned'



exports.itself = (test) ->
	sql = "INSERT INTO test_table (id, data) VALUES (3, 'third')"
	result = query sql
	expected = conn.query.sync conn, sql
	
	test.deepEqual result, expected, 'should reutn dbConnection.query result'
	
	query "DELETE FROM test_table WHERE id = 3"
	test.done()


exports.val = (test) ->
	data = query.val 'SELECT data FROM test_table WHERE id = 2'
	test.deepEqual data, 'second', 'should return the first and only value from the first and only row'

	test.throws (->
		query.val 'SELECT id, data FROM test_table WHERE id = 2'
	), Error, 'should throw error if more than one value returned'

	test.throws (->
		query.val 'SELECT * FROM test_table'
	), Error, 'should throw error if more than one row returned'

	test.throws (->
		query.val 'SELECT * FROM test_table WHERE id = 3'
	), Error, 'should throw error if no rows returned'
