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
139describe ( '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