Skip to content

Commit

Permalink
[test] Remove cli test
Browse files Browse the repository at this point in the history
`macros.spawn` doesn't receive an `exit` event - `forever` process never
exits now.
  • Loading branch information
mmalecki committed Dec 30, 2011
1 parent 9ff117d commit e57568b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 112 deletions.
67 changes: 0 additions & 67 deletions test/cli-test.js

This file was deleted.

45 changes: 0 additions & 45 deletions test/helpers/macros.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,3 @@ macros.assertTimes = function (script, times, options) {
}
};

macros.spawn = function (args, options) {
options.topic = function () {
var self = this;

args = [path.join(__dirname, '..', '..', 'bin', 'forever')].concat(args);

var child = spawn(process.argv[0], args),
stdout = '',
stderr = '';

child.stdout.on('data', function (data) {
stdout += data;
});
child.stderr.on('data', function (data) {
stderr += data;
});
child.once('exit', function (exitCode) {
//
// Remark: We wait 200 ms because of forever boot up time (master
// doesn't wait for slave to start up after it's forked, it just quits)
//
setTimeout(function () {
self.callback(null, exitCode, stdout, stderr);
}, 200);
});
};
return options;
};

macros.list = function (options) {
options.topic = function () {
forever.list(false, this.callback)
};
return options;
};

macros.assertStartsWith = function (string, substring) {
assert.equal(string.slice(0, substring.length), substring);
};

macros.assertList = function (list) {
assert.isNotNull(list);
assert.lengthOf(list, 1);
};

0 comments on commit e57568b

Please sign in to comment.