From 169fdc10bf7a5de6b306cd9265f9b57175ef4efc Mon Sep 17 00:00:00 2001 From: vvo Date: Wed, 23 May 2012 12:51:10 +0200 Subject: [PATCH] Fix test data path --- test/batch-test.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/batch-test.js b/test/batch-test.js index 76811c58..2ae8366e 100644 --- a/test/batch-test.js +++ b/test/batch-test.js @@ -1,19 +1,20 @@ var vows = require('vows'), + path = require('path'), fs = require('fs'), assert = require('assert'), cleanCSS = require('../index'); var batchContexts = function() { var context = {}; - fs.readdirSync('./test/data/').forEach(function(filename) { + fs.readdirSync(path.join(__dirname, 'data')).forEach(function(filename) { if (/min.css$/.exec(filename)) return; var testName = filename.split('.')[0]; - + context[testName] = { topic: function() { return { - plain: fs.readFileSync('./test/data/' + testName + '.css').toString('utf-8'), - minimized: fs.readFileSync('./test/data/' + testName + '-min.css').toString('utf-8').replace(/\n/g, '') + plain: fs.readFileSync(path.join(__dirname, 'data', testName + '.css')).toString('utf-8'), + minimized: fs.readFileSync(path.join(__dirname, 'data', testName + '-min.css')).toString('utf-8').replace(/\n/g, '') }; } } @@ -27,4 +28,4 @@ var batchContexts = function() { vows.describe('clean-batch') .addBatch(batchContexts()) - .export(module); \ No newline at end of file + .export(module); -- 2.34.1