/** @overview nodeunit test case. */

var testResource = require('../../../test_resource'),
    generateSizedImageFiles = require('../../../../task/worker/generate_sized_image_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 sized image files.'] = function (test) {
    var workDir = testResource.resolveWorkFile('work_generate_sized_image');
    testResource.prepareCleanWorkDir(workDir, function () {
        generateSizedImageFiles({
            src: testResource.resolveMockFile('mock-img.png'),
            sizes: [40, {width: 12, height: 12}],
            dest: testResource.resolveWorkFile(workDir, 'resized-{{width}}x{{height}}.png')
        }, function (err) {
            test.ifError(err);
            test.done();
        });
    });
};