2010-11-01 03:49:49 +08:00
|
|
|
var helper = require(__dirname + '/test-helper');
|
2011-02-24 09:50:43 +08:00
|
|
|
var Connection = require('connection');
|
2010-11-01 03:49:49 +08:00
|
|
|
var con = new Connection({stream: new MemoryStream()});
|
|
|
|
test("connection emits stream errors", function() {
|
|
|
|
assert.emits(con, 'error', function(err) {
|
|
|
|
assert.equal(err, "OMG!");
|
|
|
|
});
|
|
|
|
con.connect();
|
|
|
|
con.stream.emit('error', "OMG!");
|
|
|
|
});
|