From ec4078d5089ddfe12336a61d01583f930b7f23a9 Mon Sep 17 00:00:00 2001 From: brianc Date: Sun, 24 Oct 2010 14:45:07 -0500 Subject: [PATCH] renamed 'notificationResponse' to 'notification' for consistency --- lib/connection.js | 2 +- test/integration/connection/notification-tests.js | 2 +- test/test-buffers.js | 2 +- test/unit/connection/inbound-parser-tests.js | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/connection.js b/lib/connection.js index 28874850..e900aee1 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -189,7 +189,7 @@ var messageNames = { N: 'notice', 1: 'parseComplete', 2: 'bindComplete', - A: 'notificationResponse' + A: 'notification' }; p.parseMessage = function() { diff --git a/test/integration/connection/notification-tests.js b/test/integration/connection/notification-tests.js index 9d229414..40ed7abb 100644 --- a/test/integration/connection/notification-tests.js +++ b/test/integration/connection/notification-tests.js @@ -5,7 +5,7 @@ test('recieves notification from same connection with no payload', function() { con.query('LISTEN boom'); assert.raises(con, 'readyForQuery', function() { con.query("NOTIFY boom"); - assert.raises(con, 'notificationResponse', function(msg) { + assert.raises(con, 'notification', function(msg) { assert.equal(msg.payload, ""); assert.equal(msg.channel, 'boom') con.end(); diff --git a/test/test-buffers.js b/test/test-buffers.js index e83aca87..ed65e922 100644 --- a/test/test-buffers.js +++ b/test/test-buffers.js @@ -105,7 +105,7 @@ buffers.bindComplete = function() { return new BufferList().join(true, '2'); }; -buffers.notificationResponse = function(id, channel, payload) { +buffers.notification = function(id, channel, payload) { return new BufferList() .addInt32(id) .addCString(channel) diff --git a/test/unit/connection/inbound-parser-tests.js b/test/unit/connection/inbound-parser-tests.js index 94865b38..69554679 100644 --- a/test/unit/connection/inbound-parser-tests.js +++ b/test/unit/connection/inbound-parser-tests.js @@ -153,9 +153,10 @@ var expectedMD5PasswordMessage = { name: 'authenticationMD5Password' }; -var notificationResponseBuffer = buffers.notificationResponse(4, 'hi', 'boom'); +var notificationResponseBuffer = buffers.notification(4, 'hi', 'boom'); var expectedNotificationResponseMessage = { id: 'A', + name: 'notification', processId: 4, channel: 'hi', payload: 'boom'