YUKI Hiroshi
null+****@clear*****
Wed Mar 6 11:31:49 JST 2013
YUKI Hiroshi 2013-03-06 11:31:49 +0900 (Wed, 06 Mar 2013) New Revision: eebc868a3dc92c17764fffe4fb493c947ad76ba7 https://github.com/groonga/express-droonga/commit/eebc868a3dc92c17764fffe4fb493c947ad76ba7 Log: Create expected envelope pattern with "?connection_id=..." part of the "replyTo" Modified files: test/test-utils.js Modified: test/test-utils.js (+4 -1) =================================================================== --- test/test-utils.js 2013-03-06 11:25:31 +0900 (485be2d) +++ test/test-utils.js 2013-03-06 11:31:49 +0900 (c6b113d) @@ -299,7 +299,7 @@ function createEnvelope(type, body) { var envelope = { id: now.getTime(), date: now.toISOString(), - replyTo: 'localhost:' + testReceivePort, + replyTo: 'localhost:' + testReceivePort + '/' + testTag, statusCode: 200, type: type, body: body @@ -310,6 +310,7 @@ exports.createEnvelope = createEnvelope; function createExpectedEnvelope(type, body) { var envelope = createEnvelope(type, body); + envelope.replyTo = new RegExp('^' + envelope.replyTo + '?connection_id=\\d+$'); envelope.id = TypeOf('string'); envelope.date = InstanceOf(Date); return envelope; @@ -367,6 +368,8 @@ function assertEnvelopeEqual(actual, expected) { assert.typeOf(typeof actualValue, expectedValue.typeString, key + ' / ' + vs); + } else if (expectedValue.constructor.toString().indexOf('function RegExp') > -1) { + assert.match(actualValue, expectedValue, key + ' / ' + vs); } else { assert.deepEqual(actualValue, expectedValue, key + ' / ' + vs); } -------------- next part -------------- HTML����������������������������...Download