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

s.ross cwdinfo at gmail.com
Sun Apr 12 16:43:50 EDT 2009

Thanks. I think instead of a server, I'll need to dive into replacing  
the results of XmlRpc::Client#call unless there's some ultra-cool way  
I haven't thought of.


On Apr 12, 2009, at 1:03 PM, Stephen Eley wrote:

> 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.

More information about the rspec-users mailing list