/** @overview nodeunit test case. */

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

exports.setUp = function (done) {
    done();
};

exports.tearDown = function (done) {
    done();
};
exports['Load the styleguide template'] = function (test) {
    _generateStyleguideOverview._loadStyleguideTmpl(function (err, tmpl) {
        test.ifError(err);
        test.ok(tmpl({}));
        test.done();
    });
};

exports['Generate styleguide overview.'] = function (test) {
    var dest = testResource.resolveWorkFile('work_styleguide_overview.md');
    _generateStyleguideOverview(
        dest,
        {},
        function (err) {
            test.ifError(err);
            fs.exists(dest, function (exists) {
                test.ok(exists);
                test.done();
            });
        }
    );
};