rafamvc
rafamvc

Reputation: 8337

How to mock to twitter api using Ruby on Rails?

I'm developing a application that uses the twitter API. I'm currently using rspec with mocha, but I found it to be cumbersome and I cannot reuse the mocking that I create for a give method. Is there a way that you can have for a give call, return something, and for another call return something else? Or it needs to be by each method?

Upvotes: 1

Views: 1773

Answers (1)

rafamvc
rafamvc

Reputation: 8337

Try to use webmock or fake mock.

It allows you to stub HTTP requests and setting expectations on HTTP requests in Ruby.

Upvotes: 1

Related Questions