@@ -12,14 +12,14 @@ describe("The 'info' method", function () {
12
12
describe ( "using " + parser + " and " + ip , function ( ) {
13
13
var client ;
14
14
15
- before ( function ( done ) {
15
+ beforeEach ( function ( done ) {
16
16
client = redis . createClient . apply ( null , args ) ;
17
17
client . once ( "ready" , function ( ) {
18
18
client . flushall ( done ) ;
19
19
} ) ;
20
20
} ) ;
21
21
22
- after ( function ( ) {
22
+ afterEach ( function ( ) {
23
23
client . end ( true ) ;
24
24
} ) ;
25
25
@@ -41,9 +41,10 @@ describe("The 'info' method", function () {
41
41
client . set ( 'foo' , 'bar' ) ;
42
42
client . info ( 'keyspace' ) ;
43
43
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' ) ;
46
46
} ) ;
47
+ client . info ( [ 'keyspace' ] ) ;
47
48
client . set ( 'foo' , 'bar' ) ;
48
49
client . info ( 'all' , function ( err , res ) {
49
50
assert ( Object . keys ( client . server_info ) . length > 3 , 'Key length should be way above three' ) ;
@@ -53,6 +54,17 @@ describe("The 'info' method", function () {
53
54
} ) ;
54
55
} ) ;
55
56
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
+
56
68
it ( "emit error after a failure" , function ( done ) {
57
69
client . info ( ) ;
58
70
client . once ( 'error' , function ( err ) {
0 commit comments