@@ -226,7 +226,7 @@ vows.describe('nconf/stores/file').addBatch({
226
226
"When using the nconf file store" : {
227
227
topic : function ( ) {
228
228
var secureStore = new nconf . File ( {
229
- file : 'mock-file- path.json',
229
+ file : path . join ( __dirname , '..' , 'fixtures' , 'secure. json') ,
230
230
secure : 'super-secretzzz'
231
231
} ) ;
232
232
@@ -236,13 +236,25 @@ vows.describe('nconf/stores/file').addBatch({
236
236
"the stringify() method should encrypt properly" : function ( store ) {
237
237
var contents = JSON . parse ( store . stringify ( ) ) ;
238
238
Object . keys ( data ) . forEach ( function ( key ) {
239
- assert . isString ( contents [ key ] ) ;
239
+ assert . isObject ( contents [ key ] ) ;
240
+ assert . isString ( contents [ key ] . value ) ;
241
+ assert . equal ( contents [ key ] . alg , 'aes-256-ctr' ) ;
240
242
} ) ;
241
243
} ,
242
244
"the parse() method should decrypt properly" : function ( store ) {
243
245
var contents = store . stringify ( ) ;
244
246
var parsed = store . parse ( contents ) ;
245
247
assert . deepEqual ( parsed , data ) ;
248
+ } ,
249
+ "the load() method should decrypt properly" : function ( store ) {
250
+ store . load ( function ( err , loaded ) {
251
+ assert . isNull ( err ) ;
252
+ assert . deepEqual ( loaded , data ) ;
253
+ } ) ;
254
+ } ,
255
+ "the loadSync() method should decrypt properly" : function ( store ) {
256
+ var loaded = store . loadSync ( )
257
+ assert . deepEqual ( loaded , data ) ;
246
258
}
247
259
}
248
260
} ) . export ( module ) ;
0 commit comments