Fixes Issue #125 - Abusing externally passed in data structure

Also had to re-jig the test, as it turns out the contributor-supplied test
for this work didn't *actually* test anything :(
This commit is contained in:
ciaranj
2013-03-05 16:58:40 +00:00
parent 08fcb6881a
commit ba81ad43bd
2 changed files with 14 additions and 7 deletions

View File

@ -87,8 +87,8 @@ vows.describe('OAuth2').addBatch({
{ 'SomeHeader': '123' }),
'When calling get': {
'we should see the custom headers mixed into headers property in options passed to http-library' : function(oa) {
https.request = function(options, callback) {
assert.equal(headers["SomeHeader"], "123");
oa._executeRequest= function( http_library, options, callback ) {
assert.equal(options.headers["SomeHeader"], "123");
};
oa.get("", {});
}