1
1
/* eslint-disable no-octal */
2
2
// vim: expandtab:ts=2:sw=2
3
3
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' ) ;
12
8
13
9
describe ( 'tmp' , function ( ) {
14
10
describe ( '#tmpName()' , function ( ) {
@@ -51,7 +47,9 @@ describe('tmp', function () {
51
47
describe ( 'on issue #176' , function ( ) {
52
48
const origfn = os . tmpdir ;
53
49
it ( 'must fail on invalid os.tmpdir()' , function ( done ) {
54
- os . tmpdir = function ( ) { return undefined ; } ;
50
+ os . tmpdir = function ( ) {
51
+ return undefined ;
52
+ } ;
55
53
tmp . tmpName ( function ( err ) {
56
54
try {
57
55
assert . ok ( err instanceof Error , 'should have failed' ) ;
@@ -64,45 +62,6 @@ describe('tmp', function () {
64
62
} ) ;
65
63
} ) ;
66
64
} ) ;
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 ( ) {
106
65
} ) ;
107
66
} ) ;
108
67
} ) ;
0 commit comments