YUKI Hiroshi
null+****@clear*****
Fri Feb 8 16:55:26 JST 2013
YUKI Hiroshi 2013-02-08 16:55:26 +0900 (Fri, 08 Feb 2013) New Revision: 64596d42728ec1acbda87b8961b503abda5a8f53 https://github.com/groonga/express-kotoumi/commit/64596d42728ec1acbda87b8961b503abda5a8f53 Log: Update definition of stub plugins for the new plugin system Modified files: test/express-adaptor.test.js Modified: test/express-adaptor.test.js (+6 -4) =================================================================== --- test/express-adaptor.test.js 2013-02-08 15:00:43 +0900 (39d2f51) +++ test/express-adaptor.test.js 2013-02-08 16:55:26 +0900 (44affd3) @@ -14,8 +14,8 @@ suite('Adaption for express application', function() { var testPlugin = { api: new model.REST({ path: '/path/to/api', - toBackend: function() { return 'api requested'; }, - toClient: function() { return 'api OK'; } + toBackend: function(event, request) { return [event, 'api requested']; }, + toClient: function(event, data) { return [event, 'api OK']; } }) }; @@ -46,7 +46,7 @@ suite('Adaption for express application', function() { test('to the document root', function(done) { var onReceive = {}; - connection + connection = connection .mock('emitMessage') .takes('api', 'api requested', function() {}, { 'timeout': null }) .ctrl(2, onReceive); @@ -68,6 +68,7 @@ suite('Adaption for express application', function() { }) .wait(0.01) .next(function() { + connection.assertThrows(); onReceive.trigger(null, { body: 'API OK?' }); }) .wait(0.01) @@ -82,7 +83,7 @@ suite('Adaption for express application', function() { test('under specified path', function(done) { var onReceive = {}; - connection + connection = connection .mock('emitMessage') .takes('api', 'api requested', function() {}, { 'timeout': null }) .ctrl(2, onReceive); @@ -104,6 +105,7 @@ suite('Adaption for express application', function() { }) .wait(0.01) .next(function() { + connection.assertThrows(); onReceive.trigger(null, { body: 'API OK?' }); }) .wait(0.01) -------------- next part -------------- HTML����������������������������... ダウンロード