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,7 +110,8 @@ 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 () {
if (brackets.platform === "mac") {
brackets.fs.readdir(baseDir + "cant_read_here", function (err, contents) {
error = err;
complete = true;
@ -121,6 +122,8 @@ define(function (require, exports, module) {
runs(function () {
expect(error).toBe(brackets.fs.ERR_CANT_READ);
});
}
});
it("should return an error if invalid parameters are passed", function () {
@ -320,7 +323,8 @@ 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 () {
if (brackets.platform === "mac") {
brackets.fs.writeFile(baseDir + "cant_write_here/write_test.txt", contents, "utf8", function (err) {
error = err;
complete = true;
@ -331,6 +335,8 @@ define(function (require, exports, module) {
runs(function () {
expect(error).toBe(brackets.fs.ERR_CANT_WRITE);
});
}
});
it("should return an error if called with invalid parameters", function () {

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

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