/** @overview nodeunit test case. */

var testResource = require('../../../test_resource'),
    mockInjector = require('../../../mock_injector'),
    generateConfigDataJson = require('../../../../ci/worker/generate_config_data_json.js');

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

exports.tearDown = function (done) {
    mockInjector.restoreAll();
    done();
};


exports['Generate config data json.'] = function (test) {
    var dest = testResource.resolveWorkFile('work-config-data.json');
    generateConfigDataJson({
        src: testResource.resolveMockFile('mock-config.js'),
        dest: dest
    }, function (err) {
        test.ifError(err);
        require('fs').exists(dest, function (exists) {
            test.ok(exists);
            test.done();
        });
    });
};