@@ -12,14 +12,14 @@ describe("The 'info' method", function () {
1212 describe ( "using " + parser + " and " + ip , function ( ) {
1313 var client ;
1414
15- before ( function ( done ) {
15+ beforeEach ( function ( done ) {
1616 client = redis . createClient . apply ( null , args ) ;
1717 client . once ( "ready" , function ( ) {
1818 client . flushall ( done ) ;
1919 } ) ;
2020 } ) ;
2121
22- after ( function ( ) {
22+ afterEach ( function ( ) {
2323 client . end ( true ) ;
2424 } ) ;
2525
@@ -41,9 +41,10 @@ describe("The 'info' method", function () {
4141 client . set ( 'foo' , 'bar' ) ;
4242 client . info ( 'keyspace' ) ;
4343 client . select ( 2 , function ( ) {
44- assert . strictEqual ( Object . keys ( client . server_info ) . length , 3 , 'Key length should be three' ) ;
45- assert ( typeof client . server_info . db2 === 'object' , 'db2 keyspace should be an object' ) ;
44+ assert . strictEqual ( Object . keys ( client . server_info ) . length , 2 , 'Key length should be three' ) ;
45+ assert . strictEqual ( typeof client . server_info . db0 , 'object' , 'db0 keyspace should be an object' ) ;
4646 } ) ;
47+ client . info ( [ 'keyspace' ] ) ;
4748 client . set ( 'foo' , 'bar' ) ;
4849 client . info ( 'all' , function ( err , res ) {
4950 assert ( Object . keys ( client . server_info ) . length > 3 , 'Key length should be way above three' ) ;
@@ -53,6 +54,17 @@ describe("The 'info' method", function () {
5354 } ) ;
5455 } ) ;
5556
57+ it ( 'check redis v.2.4 support' , function ( done ) {
58+ var end = helper . callFuncAfter ( done , 2 ) ;
59+ client . send_command = function ( command , args , callback ) {
60+ assert . strictEqual ( args . length , 0 ) ;
61+ assert . strictEqual ( command , 'info' ) ;
62+ end ( ) ;
63+ } ;
64+ client . info ( ) ;
65+ client . info ( function ( ) { } ) ;
66+ } ) ;
67+
5668 it ( "emit error after a failure" , function ( done ) {
5769 client . info ( ) ;
5870 client . once ( 'error' , function ( err ) {
0 commit comments