/** @overview nodeunit test case. */

var fs = require('fs'),
    testResource = require('../../../test_resource'),
    generateThemeLessFiles = require('../../../../task/worker/generate_theme_less_files.js');

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

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


exports['Generate themes less.'] = function (test) {
    var destDir = testResource.resolveWorkFile('work-themes');
    testResource.prepareCleanWorkDir(destDir, function () {
        generateThemeLessFiles({
            dataFile: testResource.resolveMockFile('mock-style-theme-data.js'),
            destDir: destDir
        }, function (err) {
            test.ifError(err);
            fs.exists(destDir, function (exists) {
                test.ok(exists);
                test.done();
            });
        });
    });
};