Permalink
Browse files

[test] Test `kill` action

  • Loading branch information...
1 parent a0d09d2 commit 2ead453f531857cd2c85f882a234123c8fade943 @mmalecki mmalecki committed Dec 11, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 test/worker-test.js
View
@@ -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);
+ }
}
})
}

0 comments on commit 2ead453

Please sign in to comment.