diff --git a/tests/spec/fs.utimes.spec.js b/tests/spec/fs.utimes.spec.js index 253f102..4b3cb8e 100644 --- a/tests/spec/fs.utimes.spec.js +++ b/tests/spec/fs.utimes.spec.js @@ -17,7 +17,7 @@ define(["Filer", "util"], function(Filer, util) { fs.utimes('/testfile', -1, Date.now(), function (error) { expect(error).to.exist; - expect(error.name).to.equal('EInvalid'); + expect(error.code).to.equal('EINVAL'); done(); }); }); @@ -31,7 +31,7 @@ define(["Filer", "util"], function(Filer, util) { fs.utimes('/testfile', Date.now(), -1, function (error) { expect(error).to.exist; - expect(error.name).to.equal('EInvalid'); + expect(error.code).to.equal('EINVAL'); done(); }); }); @@ -45,7 +45,7 @@ define(["Filer", "util"], function(Filer, util) { fs.utimes('/testfile', 'invalid datetime', Date.now(), function (error) { expect(error).to.exist; - expect(error.name).to.equal('EInvalid'); + expect(error.code).to.equal('EINVAL'); done(); }); }); @@ -58,7 +58,7 @@ define(["Filer", "util"], function(Filer, util) { fs.utimes('/pathdoesnotexist', atime, mtime, function (error) { expect(error).to.exist; - expect(error.name).to.equal('ENoEntry'); + expect(error.code).to.equal('ENOENT'); done(); }); }); @@ -71,7 +71,7 @@ define(["Filer", "util"], function(Filer, util) { fs.utimes('/testfile', Date.now(), 'invalid datetime', function (error) { expect(error).to.exist; - expect(error.name).to.equal('EInvalid'); + expect(error.code).to.equal('EINVAL'); done(); }); }); @@ -84,7 +84,7 @@ define(["Filer", "util"], function(Filer, util) { fs.futimes(1, atime, mtime, function (error) { expect(error).to.exist; - expect(error.name).to.equal('EBadFileDescriptor'); + expect(error.code).to.equal('EBADF'); done(); }); }); diff --git a/tests/spec/fs.xattr.spec.js b/tests/spec/fs.xattr.spec.js index bb1bf80..618d94b 100644 --- a/tests/spec/fs.xattr.spec.js +++ b/tests/spec/fs.xattr.spec.js @@ -21,7 +21,7 @@ define(["Filer", "util"], function(Filer, util) { fs.setxattr('/testfile', 89, 'testvalue', function (error) { expect(error).to.exist; - expect(error.name).to.equal('EInvalid'); + expect(error.code).to.equal('EINVAL'); done(); }); }); @@ -35,7 +35,7 @@ define(["Filer", "util"], function(Filer, util) { fs.setxattr('/testfile', null, 'testvalue', function (error) { expect(error).to.exist; - expect(error.name).to.equal('EInvalid'); + expect(error.code).to.equal('EINVAL'); done(); }); }); @@ -49,7 +49,7 @@ define(["Filer", "util"], function(Filer, util) { fs.setxattr('/testfile', 'test', 'value', 'InvalidFlag', function (error) { expect(error).to.exist; - expect(error.name).to.equal('EInvalid'); + expect(error.code).to.equal('EINVAL'); done(); }); }); @@ -66,7 +66,7 @@ define(["Filer", "util"], function(Filer, util) { fs.setxattr('/testfile', 'test', 'othervalue', 'CREATE', function(error) { expect(error).to.exist; - expect(error.name).to.equal('EExists'); + expect(error.code).to.equal('EEXIST'); done(); }); }); @@ -81,7 +81,7 @@ define(["Filer", "util"], function(Filer, util) { fs.setxattr('/testfile', 'test', 'value', 'REPLACE', function(error) { expect(error).to.exist; - expect(error.name).to.equal('ENoAttr'); + expect(error.code).to.equal('ENoAttr'); done(); }); }); @@ -95,7 +95,7 @@ define(["Filer", "util"], function(Filer, util) { fs.getxattr('/testfile', '', function(error, value) { expect(error).to.exist; - expect(error.name).to.equal('EInvalid'); + expect(error.code).to.equal('EINVAL'); done(); }); }); @@ -109,7 +109,7 @@ define(["Filer", "util"], function(Filer, util) { fs.getxattr('/testfile', 89, function(error, value) { expect(error).to.exist; - expect(error.name).to.equal('EInvalid'); + expect(error.code).to.equal('EINVAL'); done(); }); }); @@ -123,7 +123,7 @@ define(["Filer", "util"], function(Filer, util) { fs.getxattr('/testfile', 'test', function(error, value) { expect(error).to.exist; - expect(error.name).to.equal('ENoAttr'); + expect(error.code).to.equal('ENoAttr'); done(); }); }); @@ -144,14 +144,14 @@ define(["Filer", "util"], function(Filer, util) { fs.fsetxattr(1, 'test', 'value', function(error) { expect(error).to.exist; - expect(error.name).to.equal('EBadFileDescriptor'); + expect(error.code).to.equal('EBADF'); completeSet = true; maybeDone(); }); fs.fgetxattr(1, 'test', function(error, value) { expect(error).to.exist; - expect(error.name).to.equal('EBadFileDescriptor'); + expect(error.code).to.equal('EBADF'); expect(value).not.to.exist; completeGet = true; maybeDone(); @@ -159,7 +159,7 @@ define(["Filer", "util"], function(Filer, util) { fs.fremovexattr(1, 'test', function(error, value) { expect(error).to.exist; - expect(error.name).to.equal('EBadFileDescriptor'); + expect(error.code).to.equal('EBADF'); completeRemove = true; maybeDone(); }); @@ -195,7 +195,7 @@ define(["Filer", "util"], function(Filer, util) { fs.removexattr('/testfile', 'testenoattr', function (error) { expect(error).to.exist; - expect(error.name).to.equal('ENoAttr'); + expect(error.code).to.equal('ENoAttr'); done(); }); }); @@ -336,7 +336,7 @@ define(["Filer", "util"], function(Filer, util) { fs.getxattr('/testfile', 'test', function (error) { expect(error).to.exist; - expect(error.name).to.equal('ENoAttr'); + expect(error.code).to.equal('ENoAttr'); done(); }); }); @@ -363,7 +363,7 @@ define(["Filer", "util"], function(Filer, util) { fs.fgetxattr(ofd, 'test', function (error) { expect(error).to.exist; - expect(error.name).to.equal('ENoAttr'); + expect(error.code).to.equal('ENoAttr'); done(); }); }); diff --git a/tests/spec/path-resolution.spec.js b/tests/spec/path-resolution.spec.js index 0fa0330..6553be8 100644 --- a/tests/spec/path-resolution.spec.js +++ b/tests/spec/path-resolution.spec.js @@ -149,7 +149,7 @@ define(["Filer", "util"], function(Filer, util) { createSymlinkChain(1, function() { fs.stat('/myfile11', function(error, result) { expect(error).to.exist; - expect(error.name).to.equal('ELoop'); + expect(error.code).to.equal('ELOOP'); expect(result).not.to.exist; done(); }); diff --git a/tests/spec/shell/cd.spec.js b/tests/spec/shell/cd.spec.js index 02bb90b..308cb7f 100644 --- a/tests/spec/shell/cd.spec.js +++ b/tests/spec/shell/cd.spec.js @@ -40,7 +40,7 @@ define(["Filer", "util"], function(Filer, util) { expect(shell.pwd()).to.equal('/'); shell.cd('/nodir', function(err) { expect(err).to.exist; - expect(err.name).to.equal('ENotDirectory'); + expect(err.code).to.equal('ENOTDIR'); expect(shell.pwd()).to.equal('/'); done(); }); @@ -57,7 +57,7 @@ define(["Filer", "util"], function(Filer, util) { expect(shell.pwd()).to.equal('/'); shell.cd('/file', function(err) { expect(err).to.exist; - expect(err.name).to.equal('ENotDirectory'); + expect(err.code).to.equal('ENOTDIR'); expect(shell.pwd()).to.equal('/'); done(); }); diff --git a/tests/spec/shell/rm.spec.js b/tests/spec/shell/rm.spec.js index 628e03f..bae180e 100644 --- a/tests/spec/shell/rm.spec.js +++ b/tests/spec/shell/rm.spec.js @@ -71,7 +71,7 @@ define(["Filer", "util"], function(Filer, util) { shell.rm('/dir', function(err) { expect(err).to.exist; - expect(err.name).to.equal('ENotEmpty'); + expect(err.code).to.equal('ENOTEMPTY'); done(); }); });