ciaranj/node-oauth — pull request #235 by jankuca (2014-12-13 16:14:30+00:00)
Title: add optional OAuth(http, https, options) constructor signature

This change makes it possible to use this module with mock HTTP and HTTPS implementations and be actually useful in a thoroughly tested project which has integration tests independent on the actual network.

```javascript
var http_mock = new MockHttp();
var https_mock = new MockHttps();

var oa = new oauth.OAuth(http_mock, https_mock, {
consumerKey: '…',
consumerSecret: '…',
signatureMethod: 'PLAINTEXT'
// + other options
});
```

In production, the module would be used simply as

```javascript
var oa = new oauth.OAuth({
consumerKey: '…',
consumerSecret: '…',
signatureMethod: 'PLAINTEXT'
// + other options
});
```

…or with explicitly provided HTTP/HTTPS implementations…

```javascript
var http = require('http');
var https = require('https');

var oa = new oauth.OAuth(http, https, {
consumerKey: '…',
consumerSecret: '…',
signatureMethod: 'PLAINTEXT'
// + other options
});
```

There are no regressions introduced to dependent packages as the original constructor signature has been preserved for backward compatibility.