Skip to content

Commit

Permalink
execute windows relative paths tests only on windows
Browse files Browse the repository at this point in the history
due to usage of nodejs Paths.dirname I could not get the windows tests to work on Linux/Mac as the \ character is not used as path separator by Paths
  • Loading branch information
wvanderdeijl committed May 30, 2016
1 parent 02145da commit c762b50
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1211,30 +1211,32 @@ describe('gulp-rev-all', function () {

});

it('windows path', function () {
if (/^win/.test(process.platform)) {
it('windows path', function () {

var base = 'c:\\first\\second';
var base = 'c:\\first\\second';

var file = new Gutil.File({
path: 'c:\\first\\second\\third\\index.html',
base: base
});
var file = new Gutil.File({
path: 'c:\\first\\second\\third\\index.html',
base: base
});

var fileReference = new Gutil.File({
path: 'c:\\first\\second\\third\\fourth\\other.html',
base: base
});
var fileReference = new Gutil.File({
path: 'c:\\first\\second\\third\\fourth\\other.html',
base: base
});

file.revPathOriginal = file.path;
fileReference.revPathOriginal = fileReference.path;
file.revPathOriginal = file.path;
fileReference.revPathOriginal = fileReference.path;

var references = Tool.get_reference_representations_relative(fileReference, file);
var references = Tool.get_reference_representations_relative(fileReference, file);

references.length.should.equal(2);
references[0].should.equal('fourth/other.html');
references[1].should.equal('./fourth/other.html');
references.length.should.equal(2);
references[0].should.equal('fourth/other.html');
references[1].should.equal('./fourth/other.html');

});
});
}

});

Expand Down

0 comments on commit c762b50

Please sign in to comment.