@@ -84,16 +84,44 @@ describe('dropBufferSupport', function () {
84
84
expect ( err ) . to . eql ( null ) ;
85
85
expect ( res [ 0 ] [ 1 ] ) . to . eql ( 'OK' ) ;
86
86
expect ( res [ 1 ] [ 1 ] ) . to . eql ( 'bar' ) ;
87
+ redis . disconnect ( ) ;
87
88
done ( ) ;
88
89
} ) ;
89
90
} ) ;
90
91
92
+ it ( 'should work with transaction' , function ( done ) {
93
+ var redis = new Redis ( { dropBufferSupport : true } ) ;
94
+ redis . multi ( )
95
+ . set ( 'foo' , 'bar' )
96
+ . get ( 'foo' )
97
+ . exec ( function ( err , res ) {
98
+ expect ( err ) . to . eql ( null ) ;
99
+ expect ( res [ 0 ] [ 1 ] ) . to . eql ( 'OK' ) ;
100
+ expect ( res [ 1 ] [ 1 ] ) . to . eql ( 'bar' ) ;
101
+ redis . disconnect ( ) ;
102
+ done ( ) ;
103
+ } ) ;
104
+ } ) ;
105
+
106
+ it ( 'should fail early with Buffer transaction' , function ( done ) {
107
+ var redis = new Redis ( { dropBufferSupport : true } ) ;
108
+ redis . multi ( )
109
+ . set ( 'foo' , 'bar' )
110
+ . getBuffer ( new Buffer ( 'foo' ) , function ( err ) {
111
+ expect ( err . message ) . to . match ( / B u f f e r m e t h o d s a r e n o t a v a i l a b l e / ) ;
112
+ redis . disconnect ( ) ;
113
+ done ( ) ;
114
+ } ) ;
115
+ } ) ;
116
+
91
117
it ( 'should work with internal select command' , function ( done ) {
92
118
var redis = new Redis ( { dropBufferSupport : true , db : 1 } ) ;
93
119
var check = new Redis ( { db : 1 } ) ;
94
120
redis . set ( 'foo' , 'bar' , function ( ) {
95
121
check . get ( 'foo' , function ( err , res ) {
96
122
expect ( res ) . to . eql ( 'bar' ) ;
123
+ redis . disconnect ( ) ;
124
+ check . disconnect ( ) ;
97
125
done ( ) ;
98
126
} ) ;
99
127
} ) ;
0 commit comments