var assert = require('assert')
var github = require('../')

it('can make simple api requests', function (done) {
  this.timeout(5000)
  github.json('get', '/users/:user/gists', {user: 'ForbesLindesay'}, function (err, res) {
    if (err) return done(err)
    assert(res.statusCode === 200)
    assert(Array.isArray(res.body))
    res.body.forEach(function (gist) {
      assert(typeof gist.url === 'string')
      assert(typeof gist.public === 'boolean')
    })
    done()
  })
})
it('can have a `host` option passed in', function (done) {
  this.timeout(5000)
  github.buffer('head', '/ForbesLindesay/github-basic', null, {host: 'github.com'}, function (err, res) {
    if (err) return done(err)
    assert(res.statusCode === 200)
    done()
  })
})
it('can make streaming requests', function (done) {
  this.timeout(20000)
  github.stream('/repos/:owner/:repo/subscribers', {
    owner: 'visionmedia',
    repo: 'jade'
  }).buffer(function (err, res) {
    if (err) return done(err)
    assert(Array.isArray(res))
    assert(res.length > 150)
    done()
  })
})
it('can make streaming requests for commits', function (done) {
  this.timeout(40000)
  github.stream('/repos/:owner/:repo/commits', {
    owner: 'visionmedia',
    repo: 'jade'
  }).buffer(function (err, res) {
    if (err) return done(err)
    assert(Array.isArray(res))
    assert(res.length > 150)
    console.dir(res)
    done()
  })
})
it('can make streaming requests with just one page', function (done) {
  this.timeout(20000)
  github.stream('/repos/:owner/:repo/subscribers', {
    owner: 'ForbesLindesay',
    repo: 'github-basic'
  }).buffer(function (err, res) {
    if (err) return done(err)
    assert(Array.isArray(res))
    done()
  })
})
@@ -53,16 +53,254 @@
 '../')%0A%0A
+var options = %7B%0A  auth: %7B%0A    type: 'oauth',%0A    token: '90993e4e47b0fdd1f51f4c67b17368c62a3d6097'%0A  %7D%0A%7D%0A%0Avar hostOptions = %7B%0A  host: 'github.com',%0A  auth: %7B%0A    type: 'oauth',%0A    token: '90993e4e47b0fdd1f51f4c67b17368c62a3d6097'%0A  %7D%0A%7D%0A%0A
 it('can 
@@ -433,16 +433,25 @@
 desay'%7D,
+ options,
  functio
@@ -867,28 +867,19 @@
 ll, 
-%7B
 host
-: 'github.com'%7D
+Options
 , fu
@@ -1147,32 +1147,41 @@
 repo: 'jade'%0A  %7D
+, options
 ).buffer(functio
@@ -1383,17 +1383,17 @@
 timeout(
-4
+2
 0000)%0A  
@@ -1455,42 +1455,71 @@
 r: '
-visionmedia',%0A    repo: 'jade'%0A  %7D
+ForbesLindesay',%0A    repo: 'browserify-middleware'%0A  %7D, options
 ).bu
@@ -1635,31 +1635,10 @@
  %3E 1
-50)%0A    console.dir(res
+40
 )%0A  
@@ -1857,16 +1857,25 @@
 sic'%0A  %7D
+, options
 ).buffer

Fix rate limiting of tests