making unit tests pass on Windows. Made tests dependent on read only directories be Mac only. Removed line ending characters from LowLevelFileIO-tests and related test media files so they are platform agnostic

This commit is contained in:
Ty Voliter 2012-03-13 13:08:24 -07:00
Родитель 9c023e4dcf
Коммит c708e21940
3 изменённых файлов: 30 добавлений и 24 удалений

Просмотреть файл

@ -110,17 +110,20 @@ define(function (require, exports, module) {
}); });
}); });
it("should return an error if the directory can't be read", function () { it("should return an error if the directory can't be read (Mac only)", function () {
brackets.fs.readdir(baseDir + "cant_read_here", function (err, contents) { if (brackets.platform === "mac") {
error = err; brackets.fs.readdir(baseDir + "cant_read_here", function (err, contents) {
complete = true; error = err;
}); complete = true;
});
waitsFor(function () { return complete; }, 1000);
waitsFor(function () { return complete; }, 1000);
runs(function () {
expect(error).toBe(brackets.fs.ERR_CANT_READ); runs(function () {
}); expect(error).toBe(brackets.fs.ERR_CANT_READ);
});
}
}); });
it("should return an error if invalid parameters are passed", function () { it("should return an error if invalid parameters are passed", function () {
@ -320,17 +323,20 @@ define(function (require, exports, module) {
}); });
}); });
it("should return an error if the file can't be written", function () { it("should return an error if the file can't be written (Mac only)", function () {
brackets.fs.writeFile(baseDir + "cant_write_here/write_test.txt", contents, "utf8", function (err) { if (brackets.platform === "mac") {
error = err; brackets.fs.writeFile(baseDir + "cant_write_here/write_test.txt", contents, "utf8", function (err) {
complete = true; error = err;
}); complete = true;
});
waitsFor(function () { return complete; }, 1000);
waitsFor(function () { return complete; }, 1000);
runs(function () {
expect(error).toBe(brackets.fs.ERR_CANT_WRITE); runs(function () {
}); expect(error).toBe(brackets.fs.ERR_CANT_WRITE);
});
}
}); });
it("should return an error if called with invalid parameters", function () { it("should return an error if called with invalid parameters", function () {

Просмотреть файл

@ -1 +1 @@
Here is file1 Here is file1

Просмотреть файл

@ -18,7 +18,7 @@ define(function (require, exports, module) {
beforeEach(function () { beforeEach(function () {
this.path = SpecRunnerUtils.getTestPath("/spec/NativeFileSystem-test-files"); this.path = SpecRunnerUtils.getTestPath("/spec/NativeFileSystem-test-files");
this.file1content = "Here is file1\n"; this.file1content = "Here is file1";
}); });
describe("Reading a directory", function () { describe("Reading a directory", function () {