From e0e070ab288b6339a01bf1d929f81baaadbf6379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ma=C5=82ecki?= Date: Sun, 25 Dec 2011 15:38:39 +0100 Subject: [PATCH] [test] Test if `File.saveSync()` returns store content Tests #27. --- test/stores/file-store-test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/stores/file-store-test.js b/test/stores/file-store-test.js index ada8be7..75ec280 100644 --- a/test/stores/file-store-test.js +++ b/test/stores/file-store-test.js @@ -94,19 +94,20 @@ vows.describe('nconf/stores/file').addBatch({ tmpStore.set(key, data[key]); }); - tmpStore.saveSync(); + var saved = tmpStore.saveSync(); fs.readFile(tmpStore.file, function (err, d) { fs.unlinkSync(tmpStore.file); return err ? that.callback(err) - : that.callback(err, JSON.parse(d.toString())); + : that.callback(err, JSON.parse(d.toString()), saved); }); }, - "should save the data correctly": function (err, read) { + "should save the data correctly": function (err, read, saved) { assert.isNull(err); assert.deepEqual(read, data); + assert.deepEqual(read, saved); } } }