@@ -85,17 +85,16 @@ var testStore = function(args) {
85
85
} ;
86
86
87
87
describe ( "Methods with options" , function ( ) {
88
+ var testInstance = caching . caching ( { store : testStore ( ) } ) ;
89
+ var testCache ;
90
+
88
91
before ( function ( ) {
89
92
key = support . random . string ( 20 ) ;
90
93
value = support . random . string ( 20 ) ;
94
+ testCache = caching . multi_caching ( [ testInstance ] ) ;
91
95
} ) ;
92
- describe ( "get with options" , function ( ) {
93
- var testInstance = caching . caching ( { store : testStore ( ) } ) ;
94
- var testCache ;
95
- before ( function ( ) {
96
- testCache = caching . multi_caching ( [ testInstance ] ) ;
97
- } ) ;
98
96
97
+ describe ( "get with options" , function ( ) {
99
98
it ( "lets us pass options by value" , function ( done ) {
100
99
var options = { value : value } ;
101
100
testCache . get ( key , options , function ( err , response ) {
@@ -116,13 +115,9 @@ describe("Methods with options", function() {
116
115
} ) ;
117
116
} ) ;
118
117
} ) ;
118
+
119
119
describe ( "set with options" , function ( ) {
120
- var testInstance = caching . caching ( { store : testStore ( ) } ) ;
121
- var testCache ;
122
120
var ttl = 60 ;
123
- before ( function ( ) {
124
- testCache = caching . multi_caching ( [ testInstance ] ) ;
125
- } ) ;
126
121
127
122
it ( "lets us pass options by value" , function ( done ) {
128
123
var options = { ttl : ttl , value : value } ;
@@ -143,13 +138,8 @@ describe("Methods with options", function() {
143
138
testCache . set ( key , value , options , function ( ) { } , options ) ;
144
139
} ) ;
145
140
} ) ;
146
- describe ( "delete with options" , function ( ) {
147
- var testInstance = caching . caching ( { store : testStore ( ) } ) ;
148
- var testCache ;
149
- before ( function ( ) {
150
- testCache = caching . multi_caching ( [ testInstance ] ) ;
151
- } ) ;
152
141
142
+ describe ( "delete with options" , function ( ) {
153
143
it ( "lets us pass options by value" , function ( done ) {
154
144
var options = { value : value } ;
155
145
testCache . del ( key , options , function ( ) {
@@ -169,12 +159,14 @@ describe("Methods with options", function() {
169
159
} ) ;
170
160
} ) ;
171
161
} ) ;
162
+
172
163
describe ( "Multiple stores with options" , function ( ) {
173
164
var testInstance = caching . caching ( { store : testStore ( ) } ) ;
174
165
var memInstance = caching . caching ( { store : "memory" } ) ;
175
166
var testCache ;
176
167
var options = { runNormal : true } ;
177
168
var ttl = 1 ;
169
+
178
170
before ( function ( ) {
179
171
key = support . random . string ( 20 ) ;
180
172
value = support . random . string ( 20 ) ;
@@ -197,6 +189,7 @@ describe("Multiple stores with options", function() {
197
189
} ) ;
198
190
} ) ;
199
191
} ) ;
192
+
200
193
it ( "lets us not pass options which only one store uses" , function ( ) {
201
194
testCache . set ( key , value , ttl , function ( err ) {
202
195
check_err ( err ) ;
0 commit comments