Updated tests already checking error name

This commit is contained in:
pbouianov 2014-03-05 14:28:31 -05:00
parent bf9ff3ab3a
commit c5ed7d4a55
5 changed files with 24 additions and 24 deletions

View File

@ -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();
});
});

View File

@ -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();
});
});

View File

@ -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();
});

View File

@ -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();
});

View File

@ -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();
});
});