Permalink
Browse files

Removed unused file task, needless indirection

  • Loading branch information...
1 parent 1046338 commit 500f7a3856a26af9501eb904026327076b76555c mde committed Aug 11, 2012
Showing with 3 additions and 84 deletions.
  1. +1 −1 lib/task/directory_task.js
  2. +1 −1 lib/task/file_task.js
  3. +1 −1 lib/task/task.js
  4. +0 −81 test/file_utils.js
@@ -20,7 +20,7 @@ DirectoryTask = function (name) {
// Do constructor-work only on actual instances, not when used
// for inheritance
if (arguments.length) {
- this.constructor.prototype.init.apply(this, arguments);
+ this.init.apply(this, arguments);
}
};
DirectoryTask.prototype = new FileTask();
View
@@ -116,7 +116,7 @@ FileTask = function (name, prereqs, action, opts) {
// Do constructor-work only on actual instances, not when used
// for inheritance
if (arguments.length) {
- this.constructor.prototype.init.apply(this, arguments);
+ this.init.apply(this, arguments);
}
};
FileTask.prototype = new Task();
View
@@ -30,7 +30,7 @@ Task = function () {
// Do constructor-work only on actual instances, not when used
// for inheritance
if (arguments.length) {
- this.constructor.prototype.init.apply(this, arguments);
+ this.init.apply(this, arguments);
}
};
View
@@ -1,81 +0,0 @@
-var assert = require('assert')
- , fs = require('fs')
- , h = require('./helpers')
- , fileUtils = require('../lib/utils/file');
-
-var tests = {
-
- 'before': function () {
- process.chdir('./test');
- }
-
-, 'after': function () {
- process.chdir('../');
- }
-
-, 'test mkdirP': function () {
- var expected = [
- 'foo'
- , 'foo/bar'
- , 'foo/bar/baz'
- , 'foo/bar/baz/qux'
- ]
- , res;
- fileUtils.mkdirP('foo/bar/baz/qux');
- res = fileUtils.readdirR('foo');
- for (var i = 0, ii = res.length; i < ii; i++) {
- assert.equal(expected[i], res[i]);
- }
- fileUtils.rmRf('foo', {silent: true});
- }
-
-, 'test rmRf': function () {
- fileUtils.mkdirP('foo/bar/baz/qux', {silent: true});
- fileUtils.rmRf('foo/bar', {silent: true});
- res = fileUtils.readdirR('foo');
- assert.equal(1, res.length);
- assert.equal('foo', res[0]);
- fs.rmdirSync('foo');
- }
-
-// TODO: Need Windows test with c:\\
-, 'test basedir with Unix absolute path': function () {
- var p = '/foo/bar/baz';
- assert.equal('/', fileUtils.basedir(p));
- }
-
-, 'test basedir with Unix absolute path and double-asterisk': function () {
- var p = '/**/foo/bar/baz';
- assert.equal('/', fileUtils.basedir(p));
- }
-
-, 'test basedir with leading double-asterisk': function () {
- var p = '**/foo';
- assert.equal('.', fileUtils.basedir(p));
- }
-
-, 'test basedir with leading asterisk': function () {
- var p = '*.js';
- assert.equal('.', fileUtils.basedir(p));
- }
-
-, 'test basedir with leading dot-slash and double-asterisk': function () {
- var p = './**/foo';
- assert.equal('.', fileUtils.basedir(p));
- }
-
-, 'test basedir with leading dirname and double-asterisk': function () {
- var p = 'a/**/*.js';
- assert.equal('a', fileUtils.basedir(p));
- }
-
-, 'test basedir with leading dot-dot-slash and double-asterisk': function () {
- var p = '../test/**/*.js';
- assert.equal('..', fileUtils.basedir(p));
- }
-
-};
-
-module.exports = tests;
-
-

0 comments on commit 500f7a3

Please sign in to comment.