Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to simulate external APIs?

We call many different external APIs in our system and now I'm looking for a system I can use to simulate those APIs so we can test ours in the Staging and Development environments?

Our application is written in Ruby on Rails 3.0 but since all the API calls to and from it are over HTTP there is no language dependency.

like image 703
Khash Avatar asked Feb 11 '26 19:02

Khash


1 Answers

VCR will record the actual input from the webservice and then replay that feedback from then on.

To simulate it completely, you can use fakeweb. You'll record output to a file and have it sent back to your application.

like image 89
Jesse Wolgamott Avatar answered Feb 14 '26 11:02

Jesse Wolgamott