зеркало из https://github.com/mozilla/brackets.git
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:
Родитель
9c023e4dcf
Коммит
c708e21940
|
@ -110,17 +110,20 @@ define(function (require, exports, module) {
|
|||
});
|
||||
});
|
||||
|
||||
it("should return an error if the directory can't be read", function () {
|
||||
brackets.fs.readdir(baseDir + "cant_read_here", function (err, contents) {
|
||||
error = err;
|
||||
complete = true;
|
||||
});
|
||||
|
||||
waitsFor(function () { return complete; }, 1000);
|
||||
|
||||
runs(function () {
|
||||
expect(error).toBe(brackets.fs.ERR_CANT_READ);
|
||||
});
|
||||
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;
|
||||
});
|
||||
|
||||
waitsFor(function () { return complete; }, 1000);
|
||||
|
||||
runs(function () {
|
||||
expect(error).toBe(brackets.fs.ERR_CANT_READ);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
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 () {
|
||||
brackets.fs.writeFile(baseDir + "cant_write_here/write_test.txt", contents, "utf8", function (err) {
|
||||
error = err;
|
||||
complete = true;
|
||||
});
|
||||
|
||||
waitsFor(function () { return complete; }, 1000);
|
||||
|
||||
runs(function () {
|
||||
expect(error).toBe(brackets.fs.ERR_CANT_WRITE);
|
||||
});
|
||||
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;
|
||||
});
|
||||
|
||||
waitsFor(function () { return complete; }, 1000);
|
||||
|
||||
runs(function () {
|
||||
expect(error).toBe(brackets.fs.ERR_CANT_WRITE);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
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 () {
|
||||
this.path = SpecRunnerUtils.getTestPath("/spec/NativeFileSystem-test-files");
|
||||
this.file1content = "Here is file1\n";
|
||||
this.file1content = "Here is file1";
|
||||
});
|
||||
|
||||
describe("Reading a directory", function () {
|
||||
|
|
Загрузка…
Ссылка в новой задаче