Mocking out TweetStream in Rails

83 views Asked by At

I'm making an app where one of my key pieces of code is executed whenever I receive a status update from an instance of the TweetStream gem's user stream client, and I'm getting to the point where I really need Unit Tests to make sure the code acts properly.

Is there a way of making unit tests for a Twitter User Stream by mocking the methods out or something? Fake requests?

I'm on rails 3.2 ruby 1.9.2

1

There are 1 answers

0
Shaun Frost Duke Jackson On BEST ANSWER

You can use something like this:

https://github.com/stympy/faker

Hope it helps.