var fs = require('fs'),
    mkdirP = require('../../../../lib/file/mkdir_p'),
    testResource = require('../../../test_resource');

exports['Make directory and parents of it.'] = function (test) {
    testResource.prepareCleanWorkDirForTestFile(__filename, function (err, workDir) {
        var dirname = testResource.resolveWorkFile(workDir, 'foo', 'bar', 'baz');
        mkdirP(dirname, function (err) {
            test.ifError(err);
            fs.exists(dirname, function (exists) {
                test.ok(exists);
                test.done();
            });
        });
    });
};