adding nodeunit test for issue #7
This commit is contained in:
parent
34de06b73d
commit
a3a546914d
1 changed files with 26 additions and 0 deletions
26
tests/mkdirSyncRecursive.js
Normal file
26
tests/mkdirSyncRecursive.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
var testCase = require('nodeunit').testCase;
|
||||
var fs = require('fs');
|
||||
var wrench = require('wrench');
|
||||
var path = require('path');
|
||||
|
||||
module.exports = testCase({
|
||||
testMkdirSyncRecursive: function(test) {
|
||||
var dir = __dirname + '/_tmp/foo/bar';
|
||||
|
||||
test.equals(path.existsSync(dir), false, 'Dir shouldn\'t exist - clean it up manually?');
|
||||
|
||||
wrench.mkdirSyncRecursive(dir, 0777);
|
||||
|
||||
test.equals(path.existsSync(dir), true, 'Dir should exist now');
|
||||
|
||||
// clean up
|
||||
while (dir != __dirname) {
|
||||
fs.rmdirSync(dir);
|
||||
dir = path.dirname(dir);
|
||||
}
|
||||
|
||||
test.done();
|
||||
},
|
||||
});
|
||||
|
||||
// vim: et ts=4 sw=4
|
||||
Reference in a new issue