Skip to content

Commit

Permalink
update request method to return stream
Browse files Browse the repository at this point in the history
  • Loading branch information
dstokes committed Oct 18, 2013
1 parent 13d4c2c commit 175d0f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/unio.js
Expand Up @@ -140,7 +140,7 @@ Unio.prototype.request = function (verb, resource, params, callback) {

// console.log('\nfinal reqOpts', util.inspect(reqOpts, true, 10, true))

request(reqOpts, function (err, res, body) {
return request(reqOpts, function (err, res, body) {
// pass error to callback, or throw if no callback was passed in
if (err) {
if (validCallback)
Expand Down
9 changes: 8 additions & 1 deletion test/unio.js
Expand Up @@ -22,4 +22,11 @@ describe('unio behavior', function () {

done()
})
})

it('rest methods return a stream', function() {
client.use('twitter')
var stream = client.get('search/tweets', { q: 'banana' })

assert(typeof stream.pipe !== 'undefined')
})
})

0 comments on commit 175d0f7

Please sign in to comment.