Sha256: b95c86642ee12817dfa4548cfffee74706a2df8069fd063b47a1cee45b56f40b

Contents?: true

Size: 1.23 KB

Versions: 19

Compression:

Stored size: 1.23 KB

Contents

'use strict';


var FsTools = require('../');
var Helper = require('./helper');
var Assert = require('assert');

var SANDBOX = Helper.SANDBOX_DIR + '/remove';

require('vows').describe('remove()').addBatch({
  'removing single file': {
    topic: function () {
      FsTools.remove(SANDBOX + '/foo/bar/baz/file', this.callback);
    },
    'removes exactly one file': function (err) {
      Assert.ok(!err, 'Has no error');
      Assert.pathNotExists(SANDBOX + '/foo/bar/baz/file');
      Assert.pathExists(SANDBOX + '/foo/bar/baz');
      Assert.pathExists(SANDBOX);
    }
  },

  'removing symbolic link': {
    topic: function () {
      FsTools.remove(SANDBOX + '/foo/bar/baz/link', this.callback);
    },
    'removes symbolic link, and not the file/dir it points to': function (err) {
      Assert.ok(!err, 'Has no error');
      Assert.pathNotExists(SANDBOX + '/foo/bar/baz/link');
      Assert.pathExists(SANDBOX + '/foo/bar/baz');
      Assert.pathExists(SANDBOX);
    }
  }
}).addBatch({
  'removing directory': {
    topic: function () {
      FsTools.remove(SANDBOX, this.callback);
    },
    'removes directory recursively': function (err) {
      Assert.ok(!err, 'Has no error');
      Assert.pathNotExists(SANDBOX);
    }
  }
}).export(module);

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 node_modules/fs-tools/test/remove-test.js
ela-4.1.5 node_modules/fs-tools/test/remove-test.js
ela-4.1.4 node_modules/fs-tools/test/remove-test.js
ela-4.1.3 node_modules/fs-tools/test/remove-test.js
ela-4.1.2 node_modules/fs-tools/test/remove-test.js
ela-4.1.1 node_modules/fs-tools/test/remove-test.js
ela-4.1.0 node_modules/fs-tools/test/remove-test.js
ela-4.0.0 node_modules/fs-tools/test/remove-test.js
ela-3.4.3 node_modules/fs-tools/test/remove-test.js
ela-3.4.2 node_modules/fs-tools/test/remove-test.js
ela-3.4.0 node_modules/fs-tools/test/remove-test.js
ela-3.3.1 node_modules/fs-tools/test/remove-test.js
ela-3.3.0 node_modules/fs-tools/test/remove-test.js
ela-3.2.0 node_modules/fs-tools/test/remove-test.js
ela-3.1.1 node_modules/fs-tools/test/remove-test.js
ela-3.1.0 node_modules/fs-tools/test/remove-test.js
ela-3.0.0 node_modules/fs-tools/test/remove-test.js
ela-2.0.0 node_modules/fs-tools/test/remove-test.js
ela-1.1.0 node_modules/fs-tools/test/remove-test.js