[Groonga-commit] groonga/express-kotoumi [master] test: Remove obsolete codes

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Feb 14 12:05:43 JST 2013


YUKI Hiroshi	2013-02-14 12:05:43 +0900 (Thu, 14 Feb 2013)

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

  Log:
    test: Remove obsolete codes

  Modified files:
    test/express-adaptor.test.js
    test/test-utils.js

  Modified: test/express-adaptor.test.js (+0 -1)
===================================================================
--- test/express-adaptor.test.js    2013-02-14 12:04:15 +0900 (4ffee0a)
+++ test/express-adaptor.test.js    2013-02-14 12:05:43 +0900 (cd861be)
@@ -7,7 +7,6 @@ var utils = require('./test-utils');
 
 var adaptor = require('../index');
 var model = require('../lib/model');
-var Connection = require('../lib/backend/connection').Connection;
 
 suite('Adaption for express application', function() {
   var testRestPlugin = {

  Modified: test/test-utils.js (+0 -40)
===================================================================
--- test/test-utils.js    2013-02-14 12:04:15 +0900 (b35d740)
+++ test/test-utils.js    2013-02-14 12:05:43 +0900 (4bb3e20)
@@ -159,46 +159,6 @@ function createClientSockets(count) {
 exports.createClientSockets = createClientSockets;
 Deferred.register('createClientSockets', createClientSockets);
 
-function createMockedBackendConnection(socketCommands, clientCount) {
-  socketCommands = socketCommands || {};
-  clientCount = Math.max(clientCount || 0, 1);
-  var connection = nodemock;
-  var onMessageControllers = [];
-  var hasSocketCommand = false;
-
-  for (var i = 0; i < clientCount; i++) {
-    onMessageControllers.push({});
-
-    Object.keys(socketCommands).forEach(function(commandName) {
-      var command = socketCommands[commandName];
-      hasSocketCommand = hasSocketCommand ||
-                           model.SocketCommand.isInstance(command);
-      if (model.PublishSubscribe.isInstance(command)) {
-        onMessageControllers[i][commandName] = {};
-        connection = connection
-          .mock('on')
-            .takes(commandName, function() {})
-            .ctrl(1, onMessageControllers[i][commandName]);
-      }
-    });
-
-    if (hasSocketCommand) {
-      onMessageControllers[i].error = {};
-      connection = connection
-        .mock('on')
-          .takes('error', function() {})
-          .ctrl(1, onMessageControllers[i].error);
-    }
-  }
-
-  if (clientCount == 1)
-    onMessageControllers = onMessageControllers[0];
-
-  connection.controllers = onMessageControllers;
-  return connection;
-}
-exports.createMockedBackendConnection = createMockedBackendConnection;
-
 function createStubbedBackendConnection() {
   return {
     emitMessage: function(type, message, callback, options) {
-------------- next part --------------
HTML����������������������������...
다운로드 



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