|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +var expect = require('expect'); |
| 4 | +var os = require('os'); |
| 5 | +var path = require('path'); |
| 6 | + |
| 7 | +var childProcess = require('child_process'); |
| 8 | +var exec = childProcess.exec; |
| 9 | + |
| 10 | +var eraseTime = require('./tool/erase-time'); |
| 11 | +var eraseLapse = require('./tool/erase-lapse'); |
| 12 | +var tildify = require('../lib/shared/tildify'); |
| 13 | + |
| 14 | +var gulpfileDir = path.resolve(__dirname, 'fixtures/gulpfiles'); |
| 15 | +var gulpfilePath = path.resolve(gulpfileDir, 'gulpfile.js'); |
| 16 | + |
| 17 | +var gulpJsPath = '\\\\?\\' + path.resolve(__dirname, '../bin/gulp.js'); |
| 18 | + |
| 19 | +describe('windows extended length paths', function() { |
| 20 | + it('Should run normaly even if using \'\\\\?\\\'prefix in paths', function(done) { |
| 21 | + if (os.platform() !== 'win32') { |
| 22 | + this.skip(); |
| 23 | + return; |
| 24 | + } |
| 25 | + |
| 26 | + var cmd = ['node', gulpJsPath, '--no-color', '--gulpfile', gulpfilePath].join(' '); |
| 27 | + |
| 28 | + exec(cmd, function cb(err, stdout, stderr) { |
| 29 | + expect(err).toEqual(null); |
| 30 | + expect(stderr).toEqual(''); |
| 31 | + |
| 32 | + var workingDir = tildify(gulpfileDir); |
| 33 | + var usingGulpfile = tildify(gulpfilePath); |
| 34 | + |
| 35 | + stdout = eraseLapse(eraseTime(stdout)); |
| 36 | + expect(stdout).toEqual('' + |
| 37 | + 'Working directory changed to ' + workingDir + '\n' + |
| 38 | + 'Using gulpfile ' + usingGulpfile + '\n' + |
| 39 | + 'Starting \'default\'...\n' + |
| 40 | + 'Starting \'test1\'...\n' + |
| 41 | + 'Starting \'noop\'...\n' + |
| 42 | + 'Finished \'noop\' after ?\n' + |
| 43 | + 'Finished \'test1\' after ?\n' + |
| 44 | + 'Starting \'test3\'...\n' + |
| 45 | + 'Starting \'described\'...\n' + |
| 46 | + 'Finished \'described\' after ?\n' + |
| 47 | + 'Finished \'test3\' after ?\n' + |
| 48 | + 'Starting \'noop\'...\n' + |
| 49 | + 'Finished \'noop\' after ?\n' + |
| 50 | + 'Finished \'default\' after ?\n' + |
| 51 | + ''); |
| 52 | + done(); |
| 53 | + }); |
| 54 | + }); |
| 55 | +}); |
0 commit comments