]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/ex-mode/node_modules/space-pen/node_modules/grim/node_modules/coffeestack/node_modules/fs-plus/node_modules/mkdirp/test/perm.js
23a7abbd232e432f93f3223b2a9272e315372319
1 var mkdirp
= require('../');
2 var path
= require('path');
3 var fs
= require('fs');
4 var test
= require('tap').test
;
6 test('async perm', function (t
) {
8 var file
= '/tmp/' + (Math
.random() * (1<<30)).toString(16);
10 mkdirp(file
, 0755, function (err
) {
12 else path
.exists(file
, function (ex
) {
13 if (!ex
) t
.fail('file not created')
14 else fs
.stat(file
, function (err
, stat
) {
17 t
.equal(stat
.mode
& 0777, 0755);
18 t
.ok(stat
.isDirectory(), 'target not a directory');
26 test('async root perm', function (t
) {
27 mkdirp('/tmp', 0755, function (err
) {