Skip to content

Commit

Permalink
[test refactor] Restructure worker test a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Dec 9, 2011
1 parent c710dc5 commit 7be6917
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/worker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@ vows.describe('forever/worker').addBatch({

worker.start(function () {
reader.connect(path.join(SOCKET_PATH, 'worker.0.sock'), function () {
reader.data(['pong'], self.callback.bind(self, null));
reader.send(['ping']);
self.callback(null, reader);
});
});
},
'it should respond with `pong`': function () {
'it should connect': {
'and respond to pings': {
topic: function (reader) {
reader.send(['ping']);
reader.data(['pong'], this.callback);
},
'with `pong`': function () {}
}
}
}
}
Expand Down

0 comments on commit 7be6917

Please sign in to comment.