var mockery = require('mockery');
var mocktwit = require('mocktwit');
describe('twitter', function () {
before(function () {
mockery.enable();
mockery.registerMock('twit', mocktwit);
});
it('receives a mock response from twitter API', function () {
mocktwit.setMockResponse({text: 'hi'});
});
it('spy outgoing requests', function () {
mocktwit.setRequestListener(function (method, path, params) {
});
});
it('receives mock stream events', function () {
mocktwit.queueMockStreamEvent('follow', {event: 'follow'});
mocktwit.queueMockStreamEvent('timeline', {text: 'hello'});
});
afterEach(function () {
mocktwit.cleanup();
});
after(function () {
mockery.disable();
});
});