@@ -4,23 +4,19 @@ var util = require("./util")
4
4
5
5
module . exports = function ( ) {
6
6
7
- this . When ( / ^ t h e ` R e s u l t C u r s o r ` i s s u m m a r i z e d $ / , function ( callback ) {
7
+ this . When ( / ^ t h e ` S t a t e m e n t R e s u l t ` i s c o n s u m e d a ` R e s u l t S u m m a r y ` i s r e t u r n e d $ / , function ( callback ) {
8
8
self = this ;
9
9
this . rc . then ( function ( res ) {
10
10
self . summary = res . summary ;
11
11
callback ( ) ;
12
12
} ) . catch ( function ( err ) { callback ( new Error ( "Rejected Promise: " + err ) ) } ) ;
13
13
} ) ;
14
14
15
- this . Then ( / ^ t h e ` R e s u l t C u r s o r ` i s f u l l y c o n s u m e d $ / , function ( ) {
15
+ this . Then ( / ^ t h e ` S t a t e m e n t R e s u l t ` i s c l o s e d $ / , function ( ) {
16
16
//No result cursor in JavaScript Driver
17
17
} ) ;
18
18
19
- this . Then ( / ^ a ` R e s u l t S u m m a r y ` i s r e t u r n e d $ / , function ( ) {
20
- //skip this boring part
21
- } ) ;
22
-
23
- this . When ( / ^ I r e q u e s t a ` s t a t e m e n t ` f r o m t h e ` R e s u l t S u m m a r y ` $ / , function ( ) {
19
+ this . When ( / ^ I r e q u e s t a ` S t a t e m e n t ` f r o m t h e ` R e s u l t S u m m a r y ` $ / , function ( ) {
24
20
this . statement = this . summary . statement
25
21
} ) ;
26
22
@@ -40,10 +36,10 @@ module.exports = function () {
40
36
}
41
37
} ) ;
42
38
43
- this . Then ( / ^ r e q u e s t i n g ` u p d a t e s t a t i s t i c s ` f r o m i t s h o u l d g i v e $ / , function ( table ) {
39
+ this . Then ( / ^ r e q u e s t i n g ` C o u n t e r s ` f r o m ` R e s u l t S u m m a r y ` s h o u l d g i v e $ / , function ( table ) {
44
40
var updateStatistics = this . summary . updateStatistics
45
41
for ( var i = 0 ; i < table . hashes ( ) . length ; i ++ ) {
46
- var statistic = table . hashes ( ) [ i ] . statistic ;
42
+ var statistic = table . hashes ( ) [ i ] . counter ;
47
43
var expected = util . literalValueToTestValueNormalIntegers ( table . hashes ( ) [ i ] . result ) ;
48
44
var given = getStatistic ( statistic , updateStatistics )
49
45
if ( ! util . compareValues ( given , expected ) ) {
@@ -60,53 +56,53 @@ module.exports = function () {
60
56
}
61
57
} ) ;
62
58
63
- this . Then ( / ^ t h e s u m m a r y h a s a ` p l a n ` $ / , function ( ) {
59
+ this . Then ( / ^ t h e ` R e s u l t S u m m a r y ` h a s a ` P l a n ` $ / , function ( ) {
64
60
if ( ! this . summary . hasPlan ( ) ) {
65
61
throw Error ( "Expected summary to have a `plan`. It did not..." ) ;
66
62
}
67
63
} ) ;
68
64
69
- this . Then ( / ^ t h e s u m m a r y d o e s n o t h a v e a ` p l a n ` $ / , function ( ) {
65
+ this . Then ( / ^ t h e ` R e s u l t S u m m a r y ` d o e s n o t h a v e a ` P l a n ` $ / , function ( ) {
70
66
if ( this . summary . hasPlan ( ) ) {
71
67
throw Error ( "Expected summary to NOT have a `plan`. It did not..." ) ;
72
68
}
73
69
} ) ;
74
70
75
- this . Then ( / ^ t h e s u m m a r y h a s a ` p r o f i l e ` $ / , function ( ) {
71
+ this . Then ( / ^ t h e ` R e s u l t S u m m a r y ` h a s a ` P r o f i l e ` $ / , function ( ) {
76
72
if ( ! this . summary . hasProfile ( ) ) {
77
73
throw Error ( "Expected summary to have a `profile plan`. It did not..." ) ;
78
74
}
79
75
} ) ;
80
76
81
- this . Then ( / ^ t h e s u m m a r y d o e s n o t h a v e a ` p r o f i l e ` $ / , function ( ) {
77
+ this . Then ( / ^ t h e ` R e s u l t S u m m a r y ` d o e s n o t h a v e a ` P r o f i l e ` $ / , function ( ) {
82
78
if ( this . summary . hasProfile ( ) ) {
83
79
throw Error ( "Expected summary to NOT have a `profile plan`. It did..." ) ;
84
80
}
85
81
} ) ;
86
82
87
- this . Then ( / ^ r e q u e s t i n g t h e ` p l a n ` i t c o n t a i n s $ / , function ( table ) {
83
+ this . Then ( / ^ r e q u e s t i n g t h e ` P l a n ` i t c o n t a i n s $ / , function ( table ) {
88
84
checkPlanExact ( table , this . summary . plan )
89
85
} ) ;
90
86
91
- this . Then ( / ^ t h e ` p l a n ` a l s o c o n t a i n s m e t h o d c a l l s f o r : $ / , function ( table ) {
87
+ this . Then ( / ^ t h e ` P l a n ` a l s o c o n t a i n s m e t h o d c a l l s f o r : $ / , function ( table ) {
92
88
checkPlan ( table , this . summary . plan )
93
89
} ) ;
94
90
95
- this . Then ( / ^ r e q u e s t i n g t h e ` p r o f i l e ` i t c o n t a i n s : $ / , function ( table ) {
91
+ this . Then ( / ^ r e q u e s t i n g t h e ` P r o f i l e ` i t c o n t a i n s : $ / , function ( table ) {
96
92
checkPlanExact ( table , this . summary . profile )
97
93
} ) ;
98
94
99
- this . Then ( / ^ t h e ` p r o f i l e ` a l s o c o n t a i n s m e t h o d c a l l s f o r : $ / , function ( table ) {
95
+ this . Then ( / ^ t h e ` P r o f i l e ` a l s o c o n t a i n s m e t h o d c a l l s f o r : $ / , function ( table ) {
100
96
checkPlan ( table , this . summary . profile )
101
97
} ) ;
102
98
103
- this . Then ( / ^ t h e s u m m a r i e s ` n o t i f i c a t i o n s ` i s e m p t y l i s t $ / , function ( table ) {
99
+ this . Then ( / ^ t h e ` R e s u l t S u m m a r y ` ` N o t i f i c a t i o n s ` i s e m p t y $ / , function ( ) {
104
100
if ( ! this . summary . notifications . length == 0 ) {
105
101
throw Error ( "Expected no notifications. Got: " + this . summary . notifications . length )
106
102
}
107
103
} ) ;
108
104
109
- this . Then ( / ^ t h e s u m m a r i e s ` n o t i f i c a t i o n s ` h a s o n e n o t i f i c a t i o n w i t h $ / , function ( table ) {
105
+ this . Then ( / ^ t h e ` R e s u l t S u m m a r y ` ` N o t i f i c a t i o n s ` h a s o n e n o t i f i c a t i o n w i t h $ / , function ( table ) {
110
106
111
107
var expected = { } ;
112
108
if ( this . summary . notifications . length > 1 ) {
@@ -156,6 +152,9 @@ this.Then(/^the summaries `notifications` has one notification with$/, function
156
152
if ( key == 'db hits' ) {
157
153
return 'dbHits'
158
154
}
155
+ if ( key == 'records' ) {
156
+ return 'rows'
157
+ }
159
158
else {
160
159
return key
161
160
}
0 commit comments