diff --git a/test/cli-test.js b/test/cli-test.js index adce8ba2..799e3d61 100644 --- a/test/cli-test.js +++ b/test/cli-test.js @@ -13,15 +13,15 @@ var fs = require('fs'), helpers = require('./helpers'), forever = require('../lib/forever'); -var script = path.join(__dirname, '..', 'examples', 'log-on-interval.js'), - options = ['--uid', 'itShouldNotGoToUIDField']; +var script = path.join(__dirname, '..', 'examples', 'log-on-interval.js'); vows.describe('forever/cli').addBatch({ 'When using forever CLI': { 'and starting script using `forever start`': helpers.spawn(['start', script], { '`forever.list` result': helpers.list({ 'should contain spawned process': function (list) { - helpers.assertList(list); + assert.isNotNull(list); + assert.lengthOf(list, 1); assert.equal(list[0].command, 'node'); assert.equal(fs.realpathSync(list[0].file), fs.realpathSync(script)); helpers.assertStartsWith(list[0].logFile, forever.config.get('root')); @@ -36,26 +36,5 @@ vows.describe('forever/cli').addBatch({ }) }) } -}).addBatch({ - 'When using forever CLI': { - 'and starting script using `forever start` with arguments': helpers.spawn(['start', script].concat(options), { - '`forever.list` result': helpers.list({ - 'should contain spawned process with proper options': function (list) { - helpers.assertList(list); - assert.notEqual(list[0].uid, 'itShouldNotGoToUIDField'); - assert.deepEqual(list[0].options, options); - } - }) - }) - } -}).addBatch({ - 'When testing forever CLI': { - 'necessary cleanup': { - topic: function () { - forever.stopAll().on('stopAll', this.callback.bind({}, null)); - }, - 'should take place': function () {} - } - } }).export(module); diff --git a/test/helpers.js b/test/helpers.js index 6df615f0..9ae4120a 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -7,6 +7,8 @@ */ var assert = require('assert'), + path = require('path'), + spawn = require('child_process').spawn, forever = require('../lib/forever'); var helpers = exports; @@ -64,11 +66,4 @@ helpers.list = function (options) { helpers.assertStartsWith = function (string, substring) { assert.equal(string.slice(0, substring.length), substring); -}; - -helpers.assertList = function (list) { - assert.isNotNull(list); - assert.lengthOf(list, 1); -}; - ->>>>>>> d07b6dc... [test] Add test for option parsing +}; \ No newline at end of file