var testResource = require('../../../test_resource'),
    compileLessDirectory = require('../../../../task/worker/compile_less_directory');

exports.setUp = function (done) {
    process.env.TASK_LOG_DISABLED = true;
    done();
};
exports.tearDown = function (done) {
    process.env.TASK_LOG_DISABLED = false;
    done();
};

exports['Compile less files.'] = function (test) {
    var workDir = testResource.resolveWorkFile('work_compile_less_files');
    testResource.prepareCleanWorkDir(workDir, function () {

        compileLessDirectory({
            srcDir: testResource.resolveMockFile('.'),
            pattern: '*.less',
            destDir: workDir
        }, function (err) {
            test.ifError(err);
            test.done();
        });
    });
};