diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-16 01:59:39 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-11-16 02:00:31 +0100 |
commit | bd65bb67e25a79b019d745b7262b2008ce2adb15 (patch) | |
tree | 89e1b032103a63737f1a703e6a943832ef261704 /node_modules/tmp/test/dir-test.js | |
parent | f91466595b651721690133f58ab37f977539e95b (diff) |
incrementally verify denoms
The denominations are not stored in a separate object store.
Diffstat (limited to 'node_modules/tmp/test/dir-test.js')
-rw-r--r-- | node_modules/tmp/test/dir-test.js | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/node_modules/tmp/test/dir-test.js b/node_modules/tmp/test/dir-test.js index 2e4e52999..9f2c282b3 100644 --- a/node_modules/tmp/test/dir-test.js +++ b/node_modules/tmp/test/dir-test.js @@ -60,11 +60,22 @@ vows.describe('Directory creation').addBatch({ 'should not return with error': assert.isNull, 'should return with a name': Test.assertName, - 'should be a file': _testDir(040700), + 'should be a directory': _testDir(040700), 'should have the provided prefix': Test.testPrefix('clike-'), 'should have the provided postfix': Test.testPostfix('-postfix') }, + 'when using name': { + topic: function () { + tmp.dir({ name: 'using-name' }, this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should be a directory': _testDir(040700), + 'should have the provided name': Test.testName(path.join(tmp.tmpdir, 'using-name')) + }, + 'when using multiple options': { topic: function () { tmp.dir({ prefix: 'foo', postfix: 'bar', mode: 0750 }, this.callback); @@ -118,7 +129,7 @@ vows.describe('Directory creation').addBatch({ 'should not return with error': assert.isNull, 'should return with a name': Test.assertName, 'should not exist': function (err, name) { - assert.ok(!existsSync(name), "Directory should be removed"); + assert.ok(!existsSync(name), 'Directory should be removed'); } }, @@ -143,7 +154,7 @@ vows.describe('Directory creation').addBatch({ 'should not return with an error': assert.isNull, 'should return with a name': Test.assertName, 'should not exist': function (err, name) { - assert.ok(!existsSync(name), "Directory should be removed"); + assert.ok(!existsSync(name), 'Directory should be removed'); } }, @@ -155,7 +166,7 @@ vows.describe('Directory creation').addBatch({ 'should not return with an error': assert.isNull, 'should return with a name': Test.assertName, 'should not exist': function (err, name) { - assert.ok(!existsSync(name), "Directory should be removed"); + assert.ok(!existsSync(name), 'Directory should be removed'); }, 'should remove symlinked dir': function(err, name) { assert.ok( @@ -171,6 +182,18 @@ vows.describe('Directory creation').addBatch({ } }, + 'unsafeCleanup === true with issue62 structure': { + topic: function () { + Test.testIssue62(this.callback); + }, + + 'should not return with an error': assert.isNull, + 'should return with a name': Test.assertName, + 'should not exist': function (err, name) { + assert.ok(!existsSync(name), 'Directory should be removed'); + } + }, + 'unsafeCleanup === false': { topic: function () { Test.testUnsafeCleanup('0', this.callback); @@ -178,7 +201,13 @@ vows.describe('Directory creation').addBatch({ 'should not return with an error': assert.isNull, 'should return with a name': Test.assertName, - 'should be a directory': _testDir(040700) + 'should be a directory': function (err, name) { + _testDir(040700)(err, name); + // make sure that everything gets cleaned up + fs.unlinkSync(path.join(name, 'should-be-removed.file')); + fs.unlinkSync(path.join(name, 'symlinkme-target')); + fs.rmdirSync(name); + } }, 'remove callback': { @@ -190,7 +219,7 @@ vows.describe('Directory creation').addBatch({ 'should return with a name': Test.assertName, 'removeCallback should remove directory': function (_err, name, removeCallback) { removeCallback(); - assert.ok(!existsSync(name), "Directory should be removed"); + assert.ok(!existsSync(name), 'Directory should be removed'); } } }).exportTo(module); |