pgte/nock — pull request #157 by spenceralger (2014-04-01 02:18:40+00:00)
Title: proxy error events when proxying a streamed response

When using a stream as the response body, proxy-ing it's `error` events provides a very basic way to emit errors from simulated responses.

I realize that it doesn't quite provide a framework for mocking network level errors, as stated in #97, but as an undocumented feature it would probably be more helpful then it would be harmful.

```js
var serverMock = nock('http://esbox.1.com')
.get('/')
.reply(200, function () {
var str = es.readable(function (count, cb) {
cb(new Error('force error'));
});
str.setEncoding = function () {}; // force nock's stream detection
return str;
});
```

Fixes #97