/** @overview nodeunit test case. */

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

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

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


exports['Tag on git.'] = function (test) {
    mockInjector.inject(tagOnGit, '_tagExists', function (t, callback) {
        callback(null, false);
    });
    mockInjector.inject(tagOnGit, '_addTag', function (t, callback) {
        callback(null);
    });
    mockInjector.inject(tagOnGit, '_pushTags', function (callback) {
        callback(null);
    });
    tagOnGit({
        versionFile: testResource.resolveMockFile('mock_version.txt')
    }, function (err) {
        test.ifError(err);
        test.done();
    });
};