Sha256: 2a3db2dd8f7f1d4ca49c31c7deb3352bc058518e49b7947394e620b7e3060508
Contents?: true
Size: 1.5 KB
Versions: 19
Compression:
Stored size: 1.5 KB
Contents
'use strict'; var FsTools = require('../'); var Helper = require('./helper'); var Assert = require('assert'); var SANDBOX = Helper.SANDBOX_DIR + '/remove-sync'; require('vows').describe('removeSync()').addBatch({ 'removing single file': { topic: function () { try { FsTools.removeSync(SANDBOX + '/foo/bar/baz/file'); this.callback(null); } catch (err) { this.callback(err); } }, '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 () { try { FsTools.removeSync(SANDBOX + '/foo/bar/baz/link'); this.callback(null); } catch (err) { this.callback(err); } }, '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 () { try { FsTools.removeSync(SANDBOX); this.callback(null); } catch (err) { this.callback(err); } }, '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