YUKI Hiroshi
null+****@clear*****
Mon Dec 16 14:50:08 JST 2013
YUKI Hiroshi 2013-12-16 14:50:08 +0900 (Mon, 16 Dec 2013) New Revision: bae4f3c8644cab156f9fc4b2bbd1ce70a6dcc77e https://github.com/droonga/express-droonga/commit/bae4f3c8644cab156f9fc4b2bbd1ce70a6dcc77e Message: Call setup and teardown functions in correct context Modified files: test/droonga-protocol/connection.test.js Modified: test/droonga-protocol/connection.test.js (+10 -4) =================================================================== --- test/droonga-protocol/connection.test.js 2013-12-16 14:28:09 +0900 (84cd306) +++ test/droonga-protocol/connection.test.js 2013-12-16 14:50:08 +0900 (5d7670d) @@ -58,7 +58,7 @@ suite('Connection', function() { var connection; var backend; - setup(function(done) { + function setupEnvironment(done) { utils.createBackend() .next(function(newBackend) { backend = newBackend; @@ -73,9 +73,9 @@ suite('Connection', function() { }); done(); }); - }); + } - teardown(function() { + function teardownEnvironment() { if (backend) { backend.close(); backend = undefined; @@ -84,7 +84,7 @@ suite('Connection', function() { connection.close(); connection = undefined; } - }); + } function createMockedMessageCallback() { var mockedCallback = nodemock; @@ -110,6 +110,9 @@ suite('Connection', function() { } suite('one way message', function() { + setup(setupEnvironment); + teardown(teardownEnvironment); + test('from front to back, without callback', function(done) { var objectMessage = connection.emitMessage('object', { command: 'foobar' }); assert.envelopeEqual(objectMessage, @@ -224,6 +227,9 @@ suite('Connection', function() { }); suite('request-response', function() { + setup(setupEnvironment); + teardown(teardownEnvironment); + test('success', function(done) { var callback = createMockedMessageCallback(); -------------- next part -------------- HTML����������������������������...Download