Unixify paths to fix tests on Windows.
This commit is contained in:
parent
3889f6b100
commit
d06a7f3f5a
@ -42,6 +42,7 @@ exports.events = {
|
||||
assertWatch([function() {
|
||||
writeAll(cwd);
|
||||
}], function(result) {
|
||||
result = helper.unixify(result);
|
||||
helper.verboseLog(result);
|
||||
test.ok(result.indexOf('lib/added.js was indeed added') !== -1, 'event not emitted when file added');
|
||||
test.ok(result.indexOf('lib/one.js was indeed changed') !== -1, 'event not emitted when file changed');
|
||||
@ -56,6 +57,7 @@ exports.events = {
|
||||
assertWatch([function() {
|
||||
writeAll(cwd);
|
||||
}], function(result) {
|
||||
result = helper.unixify(result);
|
||||
helper.verboseLog(result);
|
||||
test.ok(result.indexOf('lib/added.js was indeed added') !== -1, 'event not emitted when file added');
|
||||
test.ok(result.indexOf('lib/one.js was indeed changed') === -1, 'event should NOT have emitted when file changed');
|
||||
@ -70,6 +72,7 @@ exports.events = {
|
||||
assertWatch([function() {
|
||||
writeAll(cwd);
|
||||
}], function(result) {
|
||||
result = helper.unixify(result);
|
||||
helper.verboseLog(result);
|
||||
test.ok(result.indexOf('lib/added.js was indeed added') === -1, 'event should NOT have emitted when file added');
|
||||
test.ok(result.indexOf('lib/one.js was indeed changed') !== -1, 'event should have emitted when file changed');
|
||||
@ -84,6 +87,7 @@ exports.events = {
|
||||
assertWatch([function() {
|
||||
writeAll(cwd);
|
||||
}], function(result) {
|
||||
result = helper.unixify(result);
|
||||
helper.verboseLog(result);
|
||||
test.ok(result.indexOf('lib/added.js was indeed added') === -1, 'event should NOT have emitted when file added');
|
||||
test.ok(result.indexOf('lib/one.js was indeed changed') === -1, 'event should NOT have emitted when file changed');
|
||||
@ -98,6 +102,7 @@ exports.events = {
|
||||
assertWatch([function() {
|
||||
writeAll(cwd);
|
||||
}], function(result) {
|
||||
result = helper.unixify(result);
|
||||
helper.verboseLog(result);
|
||||
test.ok(result.indexOf('lib/added.js was indeed added') !== -1, 'event should have emitted when file added');
|
||||
test.ok(result.indexOf('lib/one.js was indeed changed') === -1, 'event should NOT have emitted when file changed');
|
||||
|
@ -97,3 +97,9 @@ helper.cleanUp = function cleanUp(files) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Helper for testing cross platform
|
||||
helper.unixify = function(str) {
|
||||
str = grunt.util.normalizelf(str);
|
||||
return str.replace(/\\/g, '/');
|
||||
};
|
||||
|
@ -53,6 +53,7 @@ exports.livereload = {
|
||||
grunt.file.write(path.join(cwd, 'lib', 'one.js'), 'var one = true;');
|
||||
});
|
||||
}], function(result) {
|
||||
result = helper.unixify(result);
|
||||
helper.verboseLog(result);
|
||||
test.ok(result.indexOf('I ran before livereload.') !== -1, 'task should have ran before live reload.');
|
||||
test.ok(result.indexOf('Live reload server started on port: 35729') !== -1, 'live reload server should have been started on port 35729.');
|
||||
@ -73,6 +74,7 @@ exports.livereload = {
|
||||
grunt.file.write(path.join(cwd, 'lib', 'one.js'), 'var one = true;');
|
||||
});
|
||||
}], function(result) {
|
||||
result = helper.unixify(result);
|
||||
helper.verboseLog(result);
|
||||
test.ok(result.indexOf('I ran before livereload.') !== -1, 'task should have ran before live reload.');
|
||||
test.ok(result.indexOf('Live reload server started on port: 8675') !== -1, 'live reload server should have been started on port 35729.');
|
||||
@ -93,6 +95,7 @@ exports.livereload = {
|
||||
grunt.file.write(path.join(cwd, 'lib', 'one.js'), 'var one = true;');
|
||||
});
|
||||
}], function(result) {
|
||||
result = helper.unixify(result);
|
||||
helper.verboseLog(result);
|
||||
test.ok(result.indexOf('I ran before livereload.') !== -1, 'task should have ran before live reload.');
|
||||
test.ok(result.indexOf('Live reload server started on port: 1337') !== -1, 'live reload server should have been started on port 35729.');
|
||||
|
Loading…
Reference in New Issue
Block a user