[Groonga-commit] groonga/express-kotoumi [master] test: Test initialization processes of default internal sender and receiver of Connection

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Jan 28 14:04:38 JST 2013


YUKI Hiroshi	2013-01-28 14:04:38 +0900 (Mon, 28 Jan 2013)

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

  Log:
    test: Test initialization processes of default internal sender and receiver of Connection

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

  Modified: test/backend-connection.test.js (+28 -0)
===================================================================
--- test/backend-connection.test.js    2013-01-28 14:00:59 +0900 (dc50e68)
+++ test/backend-connection.test.js    2013-01-28 14:04:38 +0900 (8cd9a6a)
@@ -8,6 +8,34 @@ var InstanceOf = utils.InstanceOf;
 
 var Connection = require('../lib/backend/connection').Connection;
 
+suite('Connection (initialization)', function() {
+  function assertEventEmitter(object) {
+    assert.equal(typeof object, 'object');
+    assert.equal(typeof object.emit, 'function');
+  }
+
+  test('sender', function() {
+    var connection = new Connection({ tag: 'test' });
+    assertEventEmitter(connection._sender);
+  });
+
+  test('receiver', function(done) {
+    var connection = new Connection({ tag: 'test' });
+    assertEventEmitter(connection._receiver);
+    assert.equal(connection.receivePort, undefined);
+
+    Deferred
+      .wait(0.01)
+      .next(function() {
+        assert.notEqual(connection.receivePort, undefined);
+        done();
+      })
+      .error(function(error) {
+        done(error);
+      });
+  });
+});
+
 suite('Connection', function() {
   var connection;
   var sender;
-------------- next part --------------
HTML����������������������������...
Download 



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