[Groonga-commit] groonga/express-droonga at 91d2ec0 [master] test: use existing utility method

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Jul 21 00:21:04 JST 2013


Kouhei Sutou	2013-07-21 00:21:04 +0900 (Sun, 21 Jul 2013)

  New Revision: 91d2ec0f63410e5830d0abdb3c53c41e643ee304
  https://github.com/groonga/express-droonga/commit/91d2ec0f63410e5830d0abdb3c53c41e643ee304

  Message:
    test: use existing utility method

  Modified files:
    test/backend-connection.test.js

  Modified: test/backend-connection.test.js (+5 -12)
===================================================================
--- test/backend-connection.test.js    2013-07-21 00:10:22 +0900 (616cf30)
+++ test/backend-connection.test.js    2013-07-21 00:21:04 +0900 (0a58ce5)
@@ -423,13 +423,6 @@ suite('Connection', function() {
       }
     });
 
-    function extractTypes(messages) {
-      return messages.map(function(message) {
-        var envelope = message[2];
-        return envelope.type;
-      });
-    };
-
     test('normal messaging', function(done) {
       connection.emitMessage({ message: true });
       Deferred
@@ -458,7 +451,7 @@ suite('Connection', function() {
           return deferred;
         })
         .next(function() {
-          assert.deepEqual(extractTypes(backend.received),
+          assert.deepEqual(backend.getEvents(),
                            ['type1']);
           var deferred = new Deferred();
           backend.close(function() {
@@ -487,9 +480,9 @@ suite('Connection', function() {
         .createBackend()
         .next(function(newBackend) {
           restartedBackend = newBackend;
-          assert.deepEqual(extractTypes(backend.received),
+          assert.deepEqual(backend.getEvents(),
                            ['type1']);
-          assert.deepEqual(extractTypes(restartedBackend.received),
+          assert.deepEqual(restartedBackend.getEvents(),
                            []);
 
           connection.emitMessage('type3', { message: true });
@@ -503,9 +496,9 @@ suite('Connection', function() {
           return deferred;
         })
         .next(function() {
-          assert.deepEqual(extractTypes(backend.received),
+          assert.deepEqual(backend.getEvents(),
                            ['type1']);
-          assert.deepEqual(extractTypes(restartedBackend.received),
+          assert.deepEqual(restartedBackend.getEvents(),
                            ['type2', 'type3']);
           done();
         })
-------------- next part --------------
HTML����������������������������...
Download 



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