[rspec-users] How to Spec a Web Services Client

Stephen Eley sfeley at gmail.com
Sun Apr 12 16:03:50 EDT 2009

On Sun, Apr 12, 2009 at 3:24 PM, s.ross <cwdinfo at gmail.com> wrote:
> I put a pastie out at http://pastie.org/444424, which is an implementation
> (short) of an XML-RPC client. I'm getting wrapped around an axle trying to
> figure out how to spec this without actually hitting the remote server.

I just had the same challenge with a SOAP client I'm building that
hits a fairly complicated service.  My solution was to generate a
dummy SOAP server that accepts the right calls and returns the right
kinds of dummy answers.  Since I used the wsdl2ruby script (part of
the soap4r gem) to create a client skeleton from the WSDL file,
creating a server skeleton was just another command line.  I added a
few lines to spec_helper.rb to start the server and override the
client code's service URL, and now I just fill out the return values
from the server methods as part of writing my specs for each feature.

Have Fun,
   Steve Eley (sfeley at gmail.com)
   ESCAPE POD - The Science Fiction Podcast Magazine

More information about the rspec-users mailing list