YUKI Hiroshi
null+****@clear*****
Thu Feb 7 11:36:46 JST 2013
YUKI Hiroshi 2013-02-07 11:36:46 +0900 (Thu, 07 Feb 2013) New Revision: 3910abd122f486d4ef9f289963365779eb9eba2a https://github.com/groonga/express-kotoumi/commit/3910abd122f486d4ef9f289963365779eb9eba2a Log: Rename internal event to reduce naming rules of e-mail spec: inReplyTo:* => reply:* Modified files: lib/backend/connection.js test/backend-connection.test.js Modified: lib/backend/connection.js (+2 -2) =================================================================== --- lib/backend/connection.js 2013-02-07 11:20:56 +0900 (bc53978) +++ lib/backend/connection.js 2013-02-07 11:36:46 +0900 (8255787) @@ -81,7 +81,7 @@ Connection.prototype._handleMessage = function(envelope) { var errorCode = envelope.statusCode; if (!errorCode || isSuccess(errorCode)) errorCode = null; - this.emit('inReplyTo:' + inReplyTo, errorCode, envelope); + this.emit('reply:' + inReplyTo, errorCode, envelope); } }; @@ -120,7 +120,7 @@ Connection.prototype.emitMessage = function(type, body, callback, options) { body: body }; if (callback) { - var event = 'inReplyTo:' + id; + var event = 'reply:' + id; this.once(event, callback); options.timeout = toPositiveInteger(options.timeout) || DEFAULT_RESPONSE_TIMEOUT; Modified: test/backend-connection.test.js (+6 -6) =================================================================== --- test/backend-connection.test.js 2013-02-07 11:20:56 +0900 (7cd0c1a) +++ test/backend-connection.test.js 2013-02-07 11:36:46 +0900 (200815e) @@ -317,7 +317,7 @@ suite('Connection, basic features', function() { .next(function() { assert.equal(backend.received.length, 1, 'message should be sent'); assert.deepEqual(backend.received[0][2], message); - assert.equal(connection.listeners('inReplyTo:' + message.id).length, + assert.equal(connection.listeners('reply:' + message.id).length, 1, 'response listener should be still there'); @@ -331,7 +331,7 @@ suite('Connection, basic features', function() { .wait(0.01) .next(function() { callback.assert(); - assert.equal(connection.listeners('inReplyTo:' + message.id).length, + assert.equal(connection.listeners('reply:' + message.id).length, 0, 'response listener should be removed'); done(); @@ -362,13 +362,13 @@ suite('Connection, basic features', function() { .next(function() { assert.equal(backend.received.length, 1, 'message should be sent'); assert.deepEqual(backend.received[0][2], message); - assert.equal(connection.listeners('inReplyTo:' + message.id).length, + assert.equal(connection.listeners('reply:' + message.id).length, 1, 'response listener should be still there'); }) .wait(0.02) .next(function() { - assert.equal(connection.listeners('inReplyTo:' + message.id).length, + assert.equal(connection.listeners('reply:' + message.id).length, 0, 'response listener should be removed by timeout'); callback.assert(); @@ -400,7 +400,7 @@ suite('Connection, basic features', function() { .next(function() { assert.equal(backend.received.length, 1, 'message should be sent'); assert.deepEqual(backend.received[0][2], message); - assert.equal(connection.listeners('inReplyTo:' + message.id).length, + assert.equal(connection.listeners('reply:' + message.id).length, 1, 'response listener should be still there'); @@ -412,7 +412,7 @@ suite('Connection, basic features', function() { .wait(0.01) .next(function() { callback.assert(); - assert.equal(connection.listeners('inReplyTo:' + message.id).length, + assert.equal(connection.listeners('reply:' + message.id).length, 0), 'response listener should be removed'; done(); -------------- next part -------------- HTML����������������������������... ダウンロード