Permalink
Browse files

Client's connect callback runs with err, remote connection params now

  • Loading branch information...
1 parent 5a887eb commit 3c40fc4c6bbe8222e97f5576c5ee5f76bc3b177e @timoxley committed Jan 30, 2012
Showing with 6 additions and 3 deletions.
  1. +1 −1 lib/client.js
  2. +5 −2 tests/client.js
View
@@ -55,7 +55,7 @@ Client.prototype.connect = function(host, callback) {
self.up.once('up', function(remote) {
self.ready = true
self.emit('ready', remote, self.connection)
- return callback()
+ return callback(null, remote, self.connection)
})
})
return this
View
@@ -64,9 +64,12 @@ describe('client', function() {
})
})
})
- describe('listening on a port', function() {
+ describe('connecting to a port', function() {
it('will use callback when listening on port', function(done) {
- client = new Client().connect(PORT, function() {
+ client = new Client().connect(PORT, function(err, remote, connection) {
+ assert.ok(!err)
+ assert.ok(remote)
+ assert.ok(connection.id)
done()
})
})

0 comments on commit 3c40fc4

Please sign in to comment.