added failing test for stream being passed into connection
this will allow testing of incoming and outgoing stream data without resorting to monkey patching
This commit is contained in:
parent
0df4f6037c
commit
4566a3563b
17
test/communication-tests.js
Normal file
17
test/communication-tests.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
require(__dirname+'/test-helper');
|
||||||
|
|
||||||
|
var MemoryStream = function() {
|
||||||
|
EventEmitter.call(this);
|
||||||
|
};
|
||||||
|
|
||||||
|
sys.inherits(MemoryStream, EventEmitter);
|
||||||
|
|
||||||
|
var p = MemoryStream.prototype;
|
||||||
|
|
||||||
|
test('client can take existing stream', function() {
|
||||||
|
var stream = new MemoryStream();
|
||||||
|
var client = new Client({
|
||||||
|
stream: stream
|
||||||
|
});
|
||||||
|
assert.equal(client.stream, stream);
|
||||||
|
});
|
@ -2,6 +2,7 @@ sys = require('sys');
|
|||||||
assert = require('assert');
|
assert = require('assert');
|
||||||
Client = require(__dirname+"/../lib/").Client;
|
Client = require(__dirname+"/../lib/").Client;
|
||||||
Parser = require(__dirname+"/../lib/").Parser;
|
Parser = require(__dirname+"/../lib/").Parser;
|
||||||
|
EventEmitter = require('events').EventEmitter;
|
||||||
|
|
||||||
assert.same = function(actual, expected) {
|
assert.same = function(actual, expected) {
|
||||||
for(var key in expected) {
|
for(var key in expected) {
|
||||||
|
Loading…
Reference in New Issue
Block a user