//var commands = require('../../../lib/commands'),
//    testResource = require('../../test_resource');
//
//var here = process.cwd();
//exports.setUp = function (done) {
//    process.env.APEMAN_PRINT_DISABLED = true;
//    process.chdir(testResource.resolveMockFile('mock_apeman_app'));
//    done();
//};
//exports.tearDown = function (done) {
//    process.env.APEMAN_PRINT_DISABLED = false;
//    process.chdir(here);
//    done();
//};
//
//
//exports['Load apemanfile template.'] = function (test) {
//    commands.new._loadApemanFileTmpl(function (err, tmpl) {
//        test.ifError(err);
//        test.ok(tmpl);
//        test.done();
//    });
//};
//
//exports['Create duplicate error.'] = function (test) {
//    var err = commands.new._duplicateError('foo');
//    test.ok(err);
//    test.done();
//};
//
//exports['Clean app directory.'] = function (test) {
//    var appDir = testResource.resolveWorkFile('work_commands_new');
//    commands.new._cleanAppDir(appDir, true)(function (err) {
//        test.equal(err, null);
//        test.done();
//    });
//};
//
//exports['Ask who am I.'] = function (test) {
//    commands.new._whoami(function (who) {
//        test.done();
//    });
//};
//
//exports['Create app dir.'] = function (test) {
//    var workDir = testResource.resolveWorkFile('work_new_app');
//    testResource.prepareCleanWorkDir(workDir, function () {
//        var createAppDir = commands.new._createAppDir(workDir + 'work-app-' + new Date().getTime());
//        test.ok(createAppDir);
//        createAppDir(function () {
//            test.done();
//        });
//    });
//};
//
//exports['Create a new app.'] = function (test) {
//    var workDir = testResource.resolveWorkFile('work_new_app_foo');
//    testResource.prepareCleanWorkDir(workDir, function () {
//        var here = process.cwd();
//        process.chdir(workDir);
//        var prototype = testResource.resolveMockFile('mock_apeman_app/Apemanfile.js');
//        commands.new('foo', {
//            force: true,
//            prototype: prototype
//        }, function (err) {
//            test.ifError(err);
//            commands.new('foo', {
//                force: false,
//                prototype: prototype
//            }, function (err) {
//                commands.new('foo', {
//                    force: true,
//                    prototype: prototype
//                }, function (err) {
//                    test.ifError(err);
//                    process.chdir(here);
//                    test.done();
//                });
//            });
//        });
//    });
//};
//
//exports['Create a new app with error.'] = function (test) {
//    var _cleanAppDir = commands.new._cleanAppDir;
//    commands.new._cleanAppDir = function () {
//        return function (callback) {
//            callback(new Error('something wrong'));
//        }
//    };
//    commands.new('foo', {}, function (err) {
//        test.ok(err);
//        commands.new._cleanAppDir = _cleanAppDir;
//        test.done();
//    });
//};
//
//exports['Create an apemanfile.'] = function (test) {
//    var _findupApp = commands.new._findupApp;
//    commands.new._findupApp = function () {
//        return null;
//    };
//    var job = commands.new._createApemanfile('foo', 'bar', null);
//    job(function (err) {
//        test.ok(err);
//    });
//    commands.new._findupApp = _findupApp;
//    test.done();
//};