Skip to content

Commit b8e2f29

Browse files
committed
Remove broken tests
1 parent 2892a02 commit b8e2f29

File tree

2 files changed

+11
-92
lines changed

2 files changed

+11
-92
lines changed

test/name-sync-test.js

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
/* eslint-disable no-octal */
22
// vim: expandtab:ts=2:sw=2
33

4-
const
5-
assert = require('assert'),
6-
os = require('os'),
7-
path = require('path'),
8-
inbandStandardTests = require('./name-inband-standard'),
9-
tmp = require('../lib/tmp');
10-
11-
const isWindows = os.platform() === 'win32';
4+
const assert = require('assert');
5+
const os = require('os');
6+
const inbandStandardTests = require('./name-inband-standard');
7+
const tmp = require('../lib/tmp');
128

139
describe('tmp', function () {
1410
describe('#tmpNameSync()', function () {
@@ -54,42 +50,6 @@ describe('tmp', function () {
5450
}
5551
});
5652
});
57-
describe('on issue #268', function () {
58-
const origfn = os.tmpdir;
59-
it(`should not alter ${isWindows ? 'invalid' : 'valid'} path on os.tmpdir() returning path that includes double quotes`, function () {
60-
const tmpdir = isWindows ? '"C:\\Temp With Spaces"' : '"/tmp with spaces"';
61-
os.tmpdir = function () {
62-
return tmpdir;
63-
};
64-
const name = tmp.tmpNameSync();
65-
const index = name.indexOf(path.sep + tmpdir + path.sep);
66-
try {
67-
assert.ok(index > 0, `${tmpdir} should have been a subdirectory name in ${name}`);
68-
} finally {
69-
os.tmpdir = origfn;
70-
}
71-
});
72-
it('should not alter valid path on os.tmpdir() returning path that includes single quotes', function () {
73-
const tmpdir = isWindows ? '\'C:\\Temp With Spaces\'' : '\'/tmp with spaces\'';
74-
os.tmpdir = function () {
75-
return tmpdir;
76-
};
77-
const name = tmp.tmpNameSync();
78-
const index = name.indexOf(path.sep + tmpdir + path.sep);
79-
try {
80-
assert.ok(index > 0, `${tmpdir} should have been a subdirectory name in ${name}`);
81-
} finally {
82-
os.tmpdir = origfn;
83-
}
84-
});
85-
});
86-
});
87-
88-
describe('when running standard outband tests', function () {
89-
});
90-
91-
describe('when running issue specific outband tests', function () {
9253
});
9354
});
9455
});
95-

test/name-test.js

Lines changed: 7 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
/* eslint-disable no-octal */
22
// vim: expandtab:ts=2:sw=2
33

4-
const
5-
assert = require('assert'),
6-
os = require('os'),
7-
path = require('path'),
8-
inbandStandardTests = require('./name-inband-standard'),
9-
tmp = require('../lib/tmp');
10-
11-
const isWindows = os.platform() === 'win32';
4+
const assert = require('assert');
5+
const os = require('os');
6+
const inbandStandardTests = require('./name-inband-standard');
7+
const tmp = require('../lib/tmp');
128

139
describe('tmp', function () {
1410
describe('#tmpName()', function () {
@@ -51,7 +47,9 @@ describe('tmp', function () {
5147
describe('on issue #176', function () {
5248
const origfn = os.tmpdir;
5349
it('must fail on invalid os.tmpdir()', function (done) {
54-
os.tmpdir = function () { return undefined; };
50+
os.tmpdir = function () {
51+
return undefined;
52+
};
5553
tmp.tmpName(function (err) {
5654
try {
5755
assert.ok(err instanceof Error, 'should have failed');
@@ -64,45 +62,6 @@ describe('tmp', function () {
6462
});
6563
});
6664
});
67-
describe('on issue #268', function () {
68-
const origfn = os.tmpdir;
69-
it(`should not alter ${isWindows ? 'invalid' : 'valid'} path on os.tmpdir() returning path that includes double quotes`, function (done) {
70-
const tmpdir = isWindows ? '"C:\\Temp With Spaces"' : '"/tmp with spaces"';
71-
os.tmpdir = function () { return tmpdir; };
72-
tmp.tmpName(function (err, name) {
73-
const index = name.indexOf(path.sep + tmpdir + path.sep);
74-
try {
75-
assert.ok(index > 0, `${tmpdir} should have been a subdirectory name in ${name}`);
76-
} catch (err) {
77-
return done(err);
78-
} finally {
79-
os.tmpdir = origfn;
80-
}
81-
done();
82-
});
83-
});
84-
it('should not alter valid path on os.tmpdir() returning path that includes single quotes', function (done) {
85-
const tmpdir = isWindows ? '\'C:\\Temp With Spaces\'' : '\'/tmp with spaces\'';
86-
os.tmpdir = function () { return tmpdir; };
87-
tmp.tmpName(function (err, name) {
88-
const index = name.indexOf(path.sep + tmpdir + path.sep);
89-
try {
90-
assert.ok(index > 0, `${tmpdir} should have been a subdirectory name in ${name}`);
91-
} catch (err) {
92-
return done(err);
93-
} finally {
94-
os.tmpdir = origfn;
95-
}
96-
done();
97-
});
98-
});
99-
});
100-
});
101-
102-
describe('when running standard outband tests', function () {
103-
});
104-
105-
describe('when running issue specific outband tests', function () {
10665
});
10766
});
10867
});

0 commit comments

Comments
 (0)