aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tmp/test/file-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/tmp/test/file-test.js')
-rw-r--r--node_modules/tmp/test/file-test.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/node_modules/tmp/test/file-test.js b/node_modules/tmp/test/file-test.js
index d9605b38a..b710859c0 100644
--- a/node_modules/tmp/test/file-test.js
+++ b/node_modules/tmp/test/file-test.js
@@ -79,6 +79,20 @@ vows.describe('File creation').addBatch({
'should have the provided postfix': Test.testPostfix('-postfix')
},
+ 'when using name': {
+ topic: function () {
+ tmp.file({ name: 'using-name.tmp' }, this.callback);
+ },
+
+ 'should not return with an error': assert.isNull,
+ 'should return with a name': Test.assertName,
+ 'should have the provided name': Test.testName(path.join(tmp.tmpdir, 'using-name.tmp')),
+ 'should be a file': function (err, name) {
+ _testFile(0100600, true);
+ fs.unlinkSync(name);
+ }
+ },
+
'when using multiple options': {
topic: function () {
tmp.file({ prefix: 'foo', postfix: 'bar', mode: 0640 }, this.callback);
@@ -132,7 +146,7 @@ vows.describe('File 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), "File should be removed");
+ assert.ok(!existsSync(name), 'File should be removed');
}
},
@@ -157,7 +171,7 @@ vows.describe('File 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), "File should be removed");
+ assert.ok(!existsSync(name), 'File should be removed');
}
},
@@ -170,7 +184,7 @@ vows.describe('File creation').addBatch({
'should return with a name': Test.assertName,
'removeCallback should remove file': function (_err, name, _fd, removeCallback) {
removeCallback();
- assert.ok(!existsSync(name), "File should be removed");
+ assert.ok(!existsSync(name), 'File should be removed');
}
}