Skip to content

Instantly share code, notes, and snippets.

@mpj
Created January 10, 2012 21:21
Show Gist options
  • Save mpj/1591281 to your computer and use it in GitHub Desktop.
Save mpj/1591281 to your computer and use it in GitHub Desktop.
'Graph request succeeds': when(FacebookProvider, {
get_me_called_with: 'fbtoken99887755',
should_return: {
id: '640798226',
name: 'Mattias Petter Johansson'
},
after_calling: {
https: {
function_called: 'request',
with_arguments: {
host: 'graph.facebook.com',
port: 443,
path: '/me?access_token=' + token,
method: 'GET',
headers: {
'Connection': 'close'
}
},
calls_returned_object: [
{
function_called: 'on',
with_arguments: 'data'
which_yields: [ // Call the callback sent to on('data, callback) three times
'{ "id": "640798226", ',
'"name": "Mattias Petter',
' Johansson" }'
],
with_delay: 25
},
{
function_called: 'on',
with_arguments: 'end'
which_yields_delayed: null
with_delay: 100
},
]
}
}
}),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment