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:
brianc 2010-10-05 23:42:41 -05:00
parent 0df4f6037c
commit 4566a3563b
2 changed files with 18 additions and 0 deletions

View 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);
});

View File

@ -2,6 +2,7 @@ sys = require('sys');
assert = require('assert');
Client = require(__dirname+"/../lib/").Client;
Parser = require(__dirname+"/../lib/").Parser;
EventEmitter = require('events').EventEmitter;
assert.same = function(actual, expected) {
for(var key in expected) {