~ubuntu-branches/ubuntu/wily/node-tmp/wily

« back to all changes in this revision

Viewing changes to test/dir-test.js

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-03-10 19:47:11 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20150310194711-497k54p1pge5csb7
Tags: 0.0.25-1
* New upstream release.
* Update copyright years in copyright file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
 
61
61
    'should not return with error': assert.isNull,
62
62
    'should return with a name': Test.assertName,
63
 
    'should be a file': _testDir(040700),
 
63
    'should be a directory': _testDir(040700),
64
64
    'should have the provided prefix': Test.testPrefix('clike-'),
65
65
    'should have the provided postfix': Test.testPostfix('-postfix')
66
66
  },
67
67
 
 
68
  'when using name': {
 
69
    topic: function () {
 
70
      tmp.dir({ name: 'using-name' }, this.callback);
 
71
    },
 
72
 
 
73
    'should not return with an error': assert.isNull,
 
74
    'should return with a name': Test.assertName,
 
75
    'should be a directory': _testDir(040700),
 
76
    'should have the provided name': Test.testName(path.join(tmp.tmpdir, 'using-name'))
 
77
  },
 
78
 
68
79
  'when using multiple options': {
69
80
    topic: function () {
70
81
      tmp.dir({ prefix: 'foo', postfix: 'bar', mode: 0750 }, this.callback);
118
129
    'should not return with error': assert.isNull,
119
130
    'should return with a name': Test.assertName,
120
131
    'should not exist': function (err, name) {
121
 
      assert.ok(!existsSync(name), "Directory should be removed");
 
132
      assert.ok(!existsSync(name), 'Directory should be removed');
122
133
    }
123
134
  },
124
135
 
143
154
    'should not return with an error': assert.isNull,
144
155
    'should return with a name': Test.assertName,
145
156
    'should not exist': function (err, name) {
146
 
      assert.ok(!existsSync(name), "Directory should be removed");
 
157
      assert.ok(!existsSync(name), 'Directory should be removed');
147
158
    }
148
159
  },
149
160
 
155
166
    'should not return with an error': assert.isNull,
156
167
    'should return with a name': Test.assertName,
157
168
    'should not exist': function (err, name) {
158
 
      assert.ok(!existsSync(name), "Directory should be removed");
 
169
      assert.ok(!existsSync(name), 'Directory should be removed');
159
170
    },
160
171
    'should remove symlinked dir': function(err, name) {
161
172
      assert.ok(
190
201
    'should return with a name': Test.assertName,
191
202
    'removeCallback should remove directory': function (_err, name, removeCallback) {
192
203
      removeCallback();
193
 
      assert.ok(!existsSync(name), "Directory should be removed");
 
204
      assert.ok(!existsSync(name), 'Directory should be removed');
194
205
    }
195
206
  }
196
207
}).exportTo(module);