Skip to content

Commit

Permalink
[test] Test checkProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki authored and indexzero committed Oct 22, 2011
1 parent c17d004 commit 684296a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/forever-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ vows.describe('forever').addBatch({
assert.isNotNull(err);
assert.isTrue(err.message.indexOf('does not exist') !== -1);
}
},
"checking if process exists": {
"if process process exists": {
topic: forever.checkProcess(process.pid),
"should return true": function (result) {
assert.isTrue(result);
}
},
"if process doesn't exist": {
topic: forever.checkProcess(255 * 255 * 255),
//
// This is insanely large value. On most systems there'll be no process
// with such PID. Also, there's no multiplatform way to check for
// PID limit.
//
"should return false": function (result) {
assert.isFalse(result);
}
}
}
}
}).export(module);

0 comments on commit 684296a

Please sign in to comment.