Topic: Tests involving external web services
My Rails app depends on some external web services. These are accessed via SOAP calls using soap4r.
Related to these, there are 2 things that I would like to test:
1) The normal control-flow logic: Does the function as a whole do as expected, assuming the web service responds appropriately?
2) The error handling for web service failure: Does my recovery code work correctly in the case where the web service is unavailable/unresponsive?
Now, in the spirit of a good test, I want the tests to be able to run independently of the web service actually being available. I want to be able to mock it and fake the returned results.
Does anyone have any suggestions?