[Groonga-commit] droonga/express-droonga at ad23207 [master] Call setup and teardown functions on the correct context

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Dec 16 14:52:38 JST 2013


YUKI Hiroshi	2013-12-16 14:52:38 +0900 (Mon, 16 Dec 2013)

  New Revision: ad23207dbf1f4adf079f86c44bbdc82fb0554c14
  https://github.com/droonga/express-droonga/commit/ad23207dbf1f4adf079f86c44bbdc82fb0554c14

  Message:
    Call setup and teardown functions on the correct context

  Modified files:
    test/adapter/socket.io.test.js

  Modified: test/adapter/socket.io.test.js (+13 -5)
===================================================================
--- test/adapter/socket.io.test.js    2013-12-16 14:50:08 +0900 (7c2f3fa)
+++ test/adapter/socket.io.test.js    2013-12-16 14:52:38 +0900 (56d692b)
@@ -71,11 +71,10 @@ suite('Socket.IO Adapter', function() {
     })
   };
 
-  setup(function() {
+  function setupEnvironment() {
     clientSockets = [];
-  });
-
-  teardown(function() {
+  }
+  function teardownEnvironment() {
     if (clientSockets.length) {
       clientSockets.forEach(function(clientSocket) {
         clientSocket.disconnect();
@@ -84,7 +83,10 @@ suite('Socket.IO Adapter', function() {
     utils.teardownApplication({ backend:    backend,
                                 server:     server,
                                 connection: connection });
-  });
+  }
+
+  setup(setupEnvironment);
+  teardown(teardownEnvironment);
 
   test('registration of plugin commands', function(done) {
     var basePlugin = {
@@ -233,6 +235,9 @@ suite('Socket.IO Adapter', function() {
   }
 
   suite('request-response', function() {
+    setup(setupEnvironment);
+    teardown(teardownEnvironment);
+
     testReqRep(test, 'basic', {
       clientCommand:          'reqrep',
       clientBody:             'raw request',
@@ -416,6 +421,9 @@ suite('Socket.IO Adapter', function() {
   });
 
   suite('publish-subscribe', function() {
+    setup(setupEnvironment);
+    teardown(teardownEnvironment);
+
     testReqRep(test, 'basic', {
       clientCommand:          'pubsub.subscribe',
       clientBody:             'raw request',
-------------- next part --------------
HTML����������������������������...
Download 



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