[Groonga-commit] groonga/express-kotoumi [master] test: Update test for one way messaging for various type messages

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 13 12:04:04 JST 2013


YUKI Hiroshi	2013-02-13 12:04:04 +0900 (Wed, 13 Feb 2013)

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

  Log:
    test: Update test for one way messaging for various type messages

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

  Modified: test/backend-connection.test.js (+19 -5)
===================================================================
--- test/backend-connection.test.js    2013-02-13 11:57:01 +0900 (988e11b)
+++ test/backend-connection.test.js    2013-02-13 12:04:04 +0900 (5a7c828)
@@ -139,15 +139,29 @@ suite('Connection, simple communication', function() {
   }
 
   test('one way message from front to back', function(done) {
-    var message = connection.emitMessage('testRequest', { command: 'foobar' });
-    assert.envelopeEqual(message,
-                         createExpectedEnvelope('testRequest',
+    var objectMessage = connection.emitMessage('object', { command: 'foobar' });
+    assert.envelopeEqual(objectMessage,
+                         createExpectedEnvelope('object',
                                                 { command: 'foobar' }));
+
+    var stringMessage = connection.emitMessage('string', 'string');
+    assert.envelopeEqual(stringMessage,
+                         createExpectedEnvelope('string', 'string'));
+
+    var numericMessage = connection.emitMessage('numeric', 1234);
+    assert.envelopeEqual(numericMessage,
+                         createExpectedEnvelope('numeric', 1234));
+
     Deferred
       .wait(0.01)
       .next(function() {
-        assert.equal(backend.received.length, 1, 'message should be sent');
-        assert.deepEqual(backend.received[0][2], message);
+        assert.equal(backend.received.length, 3, 'messages should be sent');
+        assert.deepEqual([backend.received[0][2],
+                          backend.received[1][2],
+                          backend.received[2][2]],
+                         [objectMessage,
+                          stringMessage,
+                          numericMessage]);
         done();
       })
       .error(function(error) {
-------------- next part --------------
HTML����������������������������...
Download 



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