@@ -8,11 +8,11 @@ test("simple, unnamed prepared statement", function(){
88 values : [ 'Brian' ]
99 } ) ;
1010
11- assert . raises ( query , 'row' , function ( row ) {
11+ assert . emits ( query , 'row' , function ( row ) {
1212 assert . equal ( row . fields [ 0 ] , 20 ) ;
1313 } ) ;
1414
15- assert . raises ( query , 'end' , function ( ) {
15+ assert . emits ( query , 'end' , function ( ) {
1616 client . end ( ) ;
1717 } ) ;
1818} ) ;
@@ -38,11 +38,11 @@ test("named prepared statement", function() {
3838 } ) ;
3939 } ) ;
4040
41- assert . raises ( query , 'row' , function ( row ) {
41+ assert . emits ( query , 'row' , function ( row ) {
4242 assert . equal ( row . fields [ 0 ] , 'Brian' ) ;
4343 } ) ;
4444
45- assert . raises ( query , 'end' , function ( ) {
45+ assert . emits ( query , 'end' , function ( ) {
4646 test ( "query was parsed" , function ( ) {
4747 assert . equal ( parseCount , 1 ) ;
4848 } ) ;
@@ -56,11 +56,11 @@ test("named prepared statement", function() {
5656 values : [ 10 , 'A%' ]
5757 } ) ;
5858
59- assert . raises ( cachedQuery , 'row' , function ( row ) {
59+ assert . emits ( cachedQuery , 'row' , function ( row ) {
6060 assert . equal ( row . fields [ 0 ] , 'Aaron' ) ;
6161 } ) ;
6262
63- assert . raises ( cachedQuery , 'end' , function ( ) {
63+ assert . emits ( cachedQuery , 'end' , function ( ) {
6464 test ( "query was only parsed one time" , function ( ) {
6565 assert . equal ( parseCount , 1 , "Should not have reparsed query" ) ;
6666 } ) ;
@@ -74,19 +74,19 @@ test("named prepared statement", function() {
7474 } ) ;
7575
7676 test ( "gets first row" , function ( ) {
77- assert . raises ( q , 'row' , function ( row ) {
77+ assert . emits ( q , 'row' , function ( row ) {
7878 assert . equal ( row . fields [ 0 ] , "Aaron" ) ;
7979
8080 test ( "gets second row" , function ( ) {
81- assert . raises ( q , 'row' , function ( row ) {
81+ assert . emits ( q , 'row' , function ( row ) {
8282 assert . equal ( row . fields [ 0 ] , "Brian" ) ;
8383 } ) ;
8484 } ) ;
8585
8686 } ) ;
8787 } ) ;
8888
89- assert . raises ( q , 'end' , function ( ) {
89+ assert . emits ( q , 'end' , function ( ) {
9090 assert . equal ( parseCount , 1 ) ;
9191 } ) ;
9292 } ) ;
@@ -111,12 +111,12 @@ test("prepared statements on different clients", function() {
111111 text : statement1
112112 } ) ;
113113 test ( 'gets right data back' , function ( ) {
114- assert . raises ( query , 'row' , function ( row ) {
114+ assert . emits ( query , 'row' , function ( row ) {
115115 assert . equal ( row . fields [ 0 ] , 26 ) ;
116116 } ) ;
117117 } ) ;
118118
119- assert . raises ( query , 'end' , function ( ) {
119+ assert . emits ( query , 'end' , function ( ) {
120120 if ( client2Finished ) {
121121 client1 . end ( ) ;
122122 client2 . end ( ) ;
@@ -135,12 +135,12 @@ test("prepared statements on different clients", function() {
135135 } ) ;
136136
137137 test ( 'gets right data' , function ( ) {
138- assert . raises ( query , 'row' , function ( row ) {
138+ assert . emits ( query , 'row' , function ( row ) {
139139 assert . equal ( row . fields [ 0 ] , 1 ) ;
140140 } ) ;
141141 } ) ;
142142
143- assert . raises ( query , 'end' , function ( ) {
143+ assert . emits ( query , 'end' , function ( ) {
144144 if ( client1Finished ) {
145145 client1 . end ( ) ;
146146 client2 . end ( ) ;
0 commit comments