flatiron/nock — pull request #114 by tinogomes (2013-07-16 16:18:33+00:00)
Title: Restricting real HTTP request that matches wiht a string/regexp

You could restrict real HTTP request...

```js
// using a string
nock.enableNetConnect('amazon.com');

// or a RegExp
nock.enableNetConnect(/(amazon|github).com/);

http.get('http://www.amazon.com/');
http.get('http://github.com/'); // only for second example

// This request will be done!
http.get('http://google.com/');
// this will throw NetConnectNotAllowedError with message:
// Nock: Not allow net connect for "google.com:80"
```