-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added logic to allow developers to utilize full request API.
- Loading branch information
Fulton Byrne
committed
Jan 5, 2016
1 parent
55f951c
commit 51c9142
Showing
3 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var path = require('path'), | ||
assert = require('assert'), | ||
events = require('events'), | ||
vows = require('vows'), | ||
sinon = require('sinon'), | ||
proxyquire = require('proxyquire'); | ||
|
||
var reqSpy = sinon.spy(); | ||
var cradle = proxyquire('../lib/cradle', { | ||
request: reqSpy | ||
}); | ||
|
||
vows.describe('cradle/raw-request').addBatch({ | ||
'Options specified in "request" are passed directly to request library': { | ||
topic: new(cradle.Connection)({ request: { someOption: 'filler' }}), | ||
'should pass through values to "request"': function(topic) { | ||
var args; | ||
var opts = { | ||
moreOptions: 'moreFiller', | ||
path: 'path' | ||
}; | ||
topic.rawRequest(opts); | ||
args = reqSpy.getCall(0).args[0]; | ||
assert(args.moreOptions, 'moreFiller'); | ||
assert(args.someOption, 'filler'); | ||
} | ||
} | ||
}).export(module); |