@@ -26,32 +26,26 @@ describe("The 'eval' method", function () {
2626 } ) ;
2727
2828 it ( 'converts a float to an integer when evaluated' , function ( done ) {
29- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
3029 client . eval ( "return 100.5" , 0 , helper . isNumber ( 100 , done ) ) ;
3130 } ) ;
3231
3332 it ( 'returns a string' , function ( done ) {
34- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
3533 client . eval ( "return 'hello world'" , 0 , helper . isString ( 'hello world' , done ) ) ;
3634 } ) ;
3735
3836 it ( 'converts boolean true to integer 1' , function ( done ) {
39- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
4037 client . eval ( "return true" , 0 , helper . isNumber ( 1 , done ) ) ;
4138 } ) ;
4239
4340 it ( 'converts boolean false to null' , function ( done ) {
44- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
4541 client . eval ( "return false" , 0 , helper . isNull ( done ) ) ;
4642 } ) ;
4743
4844 it ( 'converts lua status code to string representation' , function ( done ) {
49- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
5045 client . eval ( "return {ok='fine'}" , 0 , helper . isString ( 'fine' , done ) ) ;
5146 } ) ;
5247
5348 it ( 'converts lua error to an error response' , function ( done ) {
54- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
5549 client . eval ( "return {err='this is an error'}" , 0 , function ( err ) {
5650 assert ( err . code === undefined ) ;
5751 helper . isError ( ) ( err ) ;
@@ -60,7 +54,6 @@ describe("The 'eval' method", function () {
6054 } ) ;
6155
6256 it ( 'represents a lua table appropritely' , function ( done ) {
63- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
6457 client . eval ( "return {1,2,3,'ciao',{1,2}}" , 0 , function ( err , res ) {
6558 assert . strictEqual ( 5 , res . length ) ;
6659 assert . strictEqual ( 1 , res [ 0 ] ) ;
@@ -75,7 +68,6 @@ describe("The 'eval' method", function () {
7568 } ) ;
7669
7770 it ( 'populates keys and argv correctly' , function ( done ) {
78- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
7971 client . eval ( "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" , 2 , "a" , "b" , "c" , "d" , function ( err , res ) {
8072 assert . strictEqual ( 4 , res . length ) ;
8173 assert . strictEqual ( "a" , res [ 0 ] ) ;
@@ -87,7 +79,6 @@ describe("The 'eval' method", function () {
8779 } ) ;
8880
8981 it ( 'allows arguments to be provided in array rather than as multiple parameters' , function ( done ) {
90- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
9182 client . eval ( [ "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" , 2 , "a" , "b" , "c" , "d" ] , function ( err , res ) {
9283 assert . strictEqual ( 4 , res . length ) ;
9384 assert . strictEqual ( "a" , res [ 0 ] ) ;
@@ -99,7 +90,6 @@ describe("The 'eval' method", function () {
9990 } ) ;
10091
10192 it ( 'allows a script to be executed that accesses the redis API without callback' , function ( done ) {
102- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
10393 client . eval ( source , 0 ) ;
10494 client . get ( 'sha' , helper . isString ( 'test' , done ) ) ;
10595 } ) ;
@@ -108,24 +98,20 @@ describe("The 'eval' method", function () {
10898 var sha = crypto . createHash ( 'sha1' ) . update ( source ) . digest ( 'hex' ) ;
10999
110100 it ( 'allows a script to be executed that accesses the redis API' , function ( done ) {
111- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
112101 client . eval ( source , 0 , helper . isString ( 'OK' ) ) ;
113102 client . get ( 'sha' , helper . isString ( 'test' , done ) ) ;
114103 } ) ;
115104
116105 it ( 'can execute a script if the SHA exists' , function ( done ) {
117- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
118106 client . evalsha ( sha , 0 , helper . isString ( 'OK' ) ) ;
119107 client . get ( 'sha' , helper . isString ( 'test' , done ) ) ;
120108 } ) ;
121109
122110 it ( 'returns an error if SHA does not exist' , function ( done ) {
123- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
124111 client . evalsha ( 'ffffffffffffffffffffffffffffffffffffffff' , 0 , helper . isError ( done ) ) ;
125112 } ) ;
126113
127114 it ( 'emit an error if SHA does not exist without any callback' , function ( done ) {
128- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
129115 client . evalsha ( 'ffffffffffffffffffffffffffffffffffffffff' , 0 ) ;
130116 client . on ( 'error' , function ( err ) {
131117 assert . equal ( err . code , 'NOSCRIPT' ) ;
@@ -144,7 +130,6 @@ describe("The 'eval' method", function () {
144130 } ) ;
145131
146132 it ( 'allows a key to be incremented, and performs appropriate conversion from LUA type' , function ( done ) {
147- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
148133 client . set ( "incr key" , 0 , function ( err , reply ) {
149134 if ( err ) return done ( err ) ;
150135 client . eval ( "local foo = redis.call('incr','incr key')\n" + "return {type(foo),foo}" , 0 , function ( err , res ) {
@@ -157,7 +142,6 @@ describe("The 'eval' method", function () {
157142 } ) ;
158143
159144 it ( 'allows a bulk operation to be performed, and performs appropriate conversion from LUA type' , function ( done ) {
160- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
161145 client . set ( "bulk reply key" , "bulk reply value" , function ( err , res ) {
162146 client . eval ( "local foo = redis.call('get','bulk reply key'); return {type(foo),foo}" , 0 , function ( err , res ) {
163147 assert . strictEqual ( 2 , res . length ) ;
@@ -169,7 +153,6 @@ describe("The 'eval' method", function () {
169153 } ) ;
170154
171155 it ( 'allows a multi mulk operation to be performed, with the appropriate type conversion' , function ( done ) {
172- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
173156 client . multi ( )
174157 . del ( "mylist" )
175158 . rpush ( "mylist" , "a" )
@@ -190,7 +173,6 @@ describe("The 'eval' method", function () {
190173 } ) ;
191174
192175 it ( 'returns an appropriate representation of Lua status reply' , function ( done ) {
193- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
194176 client . eval ( "local foo = redis.call('set','mykey','myval'); return {type(foo),foo['ok']}" , 0 , function ( err , res ) {
195177 assert . strictEqual ( 2 , res . length ) ;
196178 assert . strictEqual ( "table" , res [ 0 ] ) ;
@@ -200,7 +182,6 @@ describe("The 'eval' method", function () {
200182 } ) ;
201183
202184 it ( 'returns an appropriate representation of a Lua error reply' , function ( done ) {
203- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
204185 client . set ( "error reply key" , "error reply value" , function ( err , res ) {
205186 if ( err ) return done ( err ) ;
206187 client . eval ( "local foo = redis.pcall('incr','error reply key'); return {type(foo),foo['err']}" , 0 , function ( err , res ) {
@@ -213,7 +194,6 @@ describe("The 'eval' method", function () {
213194 } ) ;
214195
215196 it ( 'returns an appropriate representation of a Lua nil reply' , function ( done ) {
216- helper . serverVersionAtLeast . call ( this , client , [ 2 , 5 , 0 ] ) ;
217197 client . del ( "nil reply key" , function ( err , res ) {
218198 if ( err ) return done ( err ) ;
219199 client . eval ( "local foo = redis.call('get','nil reply key'); return {type(foo),foo == false}" , 0 , function ( err , res ) {
0 commit comments