From 2ead453f531857cd2c85f882a234123c8fade943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ma=C5=82ecki?= Date: Sun, 11 Dec 2011 14:38:33 +0100 Subject: [PATCH] [test] Test `kill` action --- test/worker-test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/worker-test.js b/test/worker-test.js index 0f517898..fbb6bf57 100644 --- a/test/worker-test.js +++ b/test/worker-test.js @@ -33,6 +33,20 @@ vows.describe('forever/worker').addBatch({ assert.isObject(obj.data); assert.deepEqual(obj.data, obj.monitor.data); } + }, + 'and when asked to kill the process': { + topic: function (reader, _, options) { + var self = this; + + options.monitor.running = true; + reader.send(['kill']); + reader.data(['kill', 'stop'], function () { + self.callback(null, options.monitor); + }); + }, + 'it should kill the process': function (monitor) { + assert.isFalse(monitor.running); + } } }) }