corrade-nucleus-nucleons – Blame information for rev 24

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 var mkdirp = require('../').mkdirp;
2 var path = require('path');
3 var fs = require('fs');
4 var test = require('tap').test;
5 var _0755 = parseInt('0755', 8);
6  
7 var ps = [ '', 'tmp' ];
8  
9 for (var i = 0; i < 25; i++) {
10 var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 ps.push(dir);
12 }
13  
14 var file = ps.join('/');
15  
16 // a file in the way
17 var itw = ps.slice(0, 3).join('/');
18  
19  
20 test('clobber-pre', function (t) {
21 console.error("about to write to "+itw)
22 fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
23  
24 fs.stat(itw, function (er, stat) {
25 t.ifError(er)
26 t.ok(stat && stat.isFile(), 'should be file')
27 t.end()
28 })
29 })
30  
31 test('clobber', function (t) {
32 t.plan(2);
33 mkdirp(file, _0755, function (err) {
34 t.ok(err);
35 t.equal(err.code, 'ENOTDIR');
36 t.end();
37 });
38 });