[Groonga-commit] groonga/express-kotoumi [master] test/ Update codes around extra command registerations for the new plugin system

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 6 13:11:07 JST 2013


YUKI Hiroshi	2013-02-06 13:11:07 +0900 (Wed, 06 Feb 2013)

  New Revision: 4ae9d3132c0f11db7a5b953bd0bd88c2b9bc9be2
  https://github.com/groonga/express-kotoumi/commit/4ae9d3132c0f11db7a5b953bd0bd88c2b9bc9be2

  Log:
    test/ Update codes around extra command registerations for the new plugin system

  Modified files:
    test/frontend-socket.io-adaptor.test.js
    test/test-utils.js

  Modified: test/frontend-socket.io-adaptor.test.js (+2 -8)
===================================================================
--- test/frontend-socket.io-adaptor.test.js    2013-02-06 13:02:43 +0900 (c6bab1c)
+++ test/frontend-socket.io-adaptor.test.js    2013-02-06 13:11:07 +0900 (28a167d)
@@ -199,9 +199,6 @@ suite('Socket.IO API', function() {
   test('front to back, extra command', function(done) {
     var extraController = {};
     connection = utils.createMockedBackendConnection()
-      .mock('on')
-        .takes('message', function() {})
-        .ctrl(1, extraController)
       .mock('emitMessage')
         .takes('foobar', { requestMessage: true });
 
@@ -211,8 +208,8 @@ suite('Socket.IO API', function() {
         server = newServer;
         socketIoAdaptor.register(application, server, {
           connection: connection,
-          extraCommands: [
-            'foobar'
+          plugins: [
+            { 'foobar': {} }
           ]
         });
 
@@ -225,9 +222,6 @@ suite('Socket.IO API', function() {
       .wait(0.01)
       .next(function() {
         connection.assertThrows();
-        connection
-          .mock('removeListener')
-          .takes('message', function() {});
         done();
       })
       .error(function(error) {

  Modified: test/test-utils.js (+7 -2)
===================================================================
--- test/test-utils.js    2013-02-06 13:02:43 +0900 (68e09a6)
+++ test/test-utils.js    2013-02-06 13:11:07 +0900 (a3ad42c)
@@ -148,10 +148,16 @@ function createMockedBackendConnection() {
     onMessageControllers[command] = {};
     connection = connection
       .mock('on')
-        .takes('message', function() {})
+        .takes(command, function() {})
         .ctrl(1, onMessageControllers[command]);
   });
 
+  onMessageControllers.message = {};
+  connection = connection
+    .mock('on')
+      .takes('message', function() {})
+      .ctrl(1, onMessageControllers.message);
+
   onMessageControllers.error = {};
   connection = connection
     .mock('on')
@@ -179,7 +185,6 @@ function readyToDestroyMockedConnection(connection) {
   connection = connection
     .mock('removeListener')
       .takes('message', function() {})
-      .times(socketIoDefaultCommands.length)
     .mock('removeListener')
       .takes('error', function() {});
   return connection;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index