Skip to content

Commit

Permalink
[test] Test kill action
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Dec 11, 2011
1 parent a0d09d2 commit 2ead453
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/worker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
})
}
Expand Down

0 comments on commit 2ead453

Please sign in to comment.