| 1 |
"use strict"; |
| 2 |
|
| 3 |
var lstat = require("../lstat") |
| 4 |
, mkdir = require("../mkdir") |
| 5 |
, writeFile = require("../write-file") |
| 6 |
, testFile = require("path").resolve(__dirname, "__playground/rm-file") |
| 7 |
, testDir = require("path").resolve(__dirname, "__playground/rm-dir"); |
| 8 |
|
| 9 |
module.exports = { |
| 10 |
File: function (t, a, d) { |
| 11 |
return writeFile(testFile, "foo")(function () { |
| 12 |
return lstat(testFile)(function () { |
| 13 |
return t(testFile)(function () { |
| 14 |
return lstat(testFile)(a.never, function (err) { |
| 15 |
a(err.code, "ENOENT"); |
| 16 |
return t(testFile + "bla", { loose: true }).catch(a.never); |
| 17 |
}); |
| 18 |
}); |
| 19 |
}); |
| 20 |
}).done(d, d); |
| 21 |
}, |
| 22 |
Directory: function (t, a, d) { |
| 23 |
mkdir(testDir)(function () { |
| 24 |
return lstat(testDir)(function () { |
| 25 |
return t(testDir)(function () { |
| 26 |
return lstat(testDir)(a.never, function (err) { a(err.code, "ENOENT"); }); |
| 27 |
}); |
| 28 |
}); |
| 29 |
}).done(d, d); |
| 30 |
} |
| 31 |
}; |