[Groonga-commit] groonga/express-kotoumi [master] test: Rewrite tests for receiver.js for new FluentReceiver

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Feb 1 10:50:12 JST 2013


YUKI Hiroshi	2013-02-01 10:50:12 +0900 (Fri, 01 Feb 2013)

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

  Log:
    test: Rewrite tests for receiver.js for new FluentReceiver

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

  Modified: test/backend-receiver.test.js (+7 -7)
===================================================================
--- test/backend-receiver.test.js    2013-02-01 10:49:38 +0900 (d16a9c6)
+++ test/backend-receiver.test.js    2013-02-01 10:50:12 +0900 (11706f8)
@@ -4,9 +4,9 @@ var Deferred = require('jsdeferred').Deferred;
 
 var utils = require('./test-utils');
 
-var Receiver = require('../lib/backend/receiver').Receiver;
+var FluentReceiver = require('../lib/backend/receiver').FluentReceiver;
 
-suite('Receiver', function() {
+suite('FluentReceiver', function() {
   var receiver;
 
   teardown(function() {
@@ -22,7 +22,7 @@ suite('Receiver', function() {
           .mock('receive')
             .takes({ message: true });
 
-    receiver = new Receiver();
+    receiver = new FluentReceiver();
     receiver.on('kotoumi.message', function(data) {
       mockedReceiver.receive(data);
     });
@@ -35,7 +35,7 @@ suite('Receiver', function() {
       .next(function() {
         assert.notEqual(receiver.port, undefined);
 
-        var rawPacket = { tag: 'kotoumi.message', data: { message: true } };
+        var rawPacket = ['kotoumi.message', Number, { message: true }];
         return utils.sendPacketTo(rawPacket, receiver.port);
       })
       .next(function() {
@@ -55,7 +55,7 @@ suite('Receiver', function() {
           .mock('receive')
             .takes({ message2: true });
 
-    receiver = new Receiver();
+    receiver = new FluentReceiver();
     receiver.on('kotoumi.message', function(data) {
       mockedReceiver.receive(data);
     });
@@ -68,11 +68,11 @@ suite('Receiver', function() {
       .next(function() {
         assert.notEqual(receiver.port, undefined);
 
-        var rawPacket = { tag: 'kotoumi.message', data: { message1: true } };
+        var rawPacket = ['kotoumi.message', Number, { message1: true }];
         return utils.sendPacketTo(rawPacket, receiver.port);
       })
       .next(function() {
-        var rawPacket = { tag: 'kotoumi.message', data: { message2: true } };
+        var rawPacket = ['kotoumi.message', Number, { message2: true }];
         return utils.sendPacketTo(rawPacket, receiver.port);
       })
       .next(function() {
-------------- next part --------------
HTML����������������������������...
Download 



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