From ceb5e52bbdfe9bb1d916b5a7c6b15518de6f8a8e Mon Sep 17 00:00:00 2001 From: Chunpeng Huo Date: Thu, 9 Jan 2020 15:38:47 +1100 Subject: [PATCH] test: clarify tests --- test/lib/descriptor.spec.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/lib/descriptor.spec.js b/test/lib/descriptor.spec.js index 9d64a8bc..ef5e8ed5 100644 --- a/test/lib/descriptor.spec.js +++ b/test/lib/descriptor.spec.js @@ -91,8 +91,8 @@ describe('FileDescriptor', function() { assert.isTrue(fd.isAppend()); }); - it('not opened for appending (O_CREAT)', function() { - const fd = new FileDescriptor(constants.O_CREAT); + it('not opened for appending (O_CREAT | O_RDONLY)', function() { + const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isFalse(fd.isAppend()); }); }); @@ -158,8 +158,8 @@ describe('FileDescriptor', function() { assert.isFalse(fd.isTruncate()); }); - it('not opened for truncating (O_CREAT)', function() { - const fd = new FileDescriptor(constants.O_CREAT); + it('not opened for truncating (O_CREAT | O_RDONLY)', function() { + const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isFalse(fd.isTruncate()); }); }); @@ -225,8 +225,8 @@ describe('FileDescriptor', function() { assert.isTrue(fd.isCreate()); }); - it('opened for creation (O_CREAT)', function() { - const fd = new FileDescriptor(constants.O_CREAT); + it('opened for creation (O_CREAT | O_RDONLY)', function() { + const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isTrue(fd.isCreate()); }); }); @@ -292,8 +292,8 @@ describe('FileDescriptor', function() { assert.isTrue(fd.isRead()); }); - it('opened for reading (O_CREAT)', function() { - const fd = new FileDescriptor(constants.O_CREAT); + it('opened for reading (O_CREAT | O_RDONLY)', function() { + const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isTrue(fd.isRead()); }); }); @@ -359,8 +359,8 @@ describe('FileDescriptor', function() { assert.isTrue(fd.isWrite()); }); - it('not opened for writing (O_CREAT)', function() { - const fd = new FileDescriptor(constants.O_CREAT); + it('not opened for writing (O_CREAT | O_RDONLY)', function() { + const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isFalse(fd.isWrite()); }); }); @@ -426,8 +426,8 @@ describe('FileDescriptor', function() { assert.isTrue(fd.isExclusive()); }); - it('not opened for exclusive (O_CREAT)', function() { - const fd = new FileDescriptor(constants.O_CREAT); + it('not opened for exclusive (O_CREAT | O_RDONLY)', function() { + const fd = new FileDescriptor(constants.O_CREAT | constants.O_RDONLY); assert.isFalse(fd.isExclusive()); }); });