Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Fakeweb + soap4r + RSpec
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
zilkey  
View profile  
 More options May 31 2009, 4:37 pm
From: zilkey <j...@zilkey.com>
Date: Sun, 31 May 2009 13:37:37 -0700 (PDT)
Local: Sun, May 31 2009 4:37 pm
Subject: Fakeweb + soap4r + RSpec
I'm trying to get Fakeweb to intercept all of my soap4r calls in
rspec.  I've got a spec that looks like this (pseudo code):

require File.expand_path(File.dirname(__FILE__) + '/../../
spec_helper')
require 'fakeweb'

describe MySoap4RClass do
  before do
        @credentials = SomeCredentials.new(:username =>
"foo", :password => "bar")
  end

  it "should intercept all calls to soap4r" do
    FakeWeb.allow_net_connect = false
    VerticalResponseProvider.vr_login(@credentials)
  end
end

I would expect to get a NetConnectNotAllowed error, but instead it
does the network call and gives me the actual web service error.

Is there a way to intercept all HTTP calls from within soap4r?  I'm
using the soap4r gem, v 1.5.8 and the fakeweb gem, v 1.2.3

Thanks,

Jeff


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Patterson  
View profile  
 More options May 31 2009, 6:18 pm
From: Matt Patterson <m...@reprocessed.org>
Date: Sun, 31 May 2009 23:18:15 +0100
Local: Sun, May 31 2009 6:18 pm
Subject: Re: [fakeweb] Fakeweb + soap4r + RSpec
On 31 May 2009, at 21:37, zilkey wrote:

> I would expect to get a NetConnectNotAllowed error, but instead it
> does the network call and gives me the actual web service error.

> Is there a way to intercept all HTTP calls from within soap4r?  I'm
> using the soap4r gem, v 1.5.8 and the fakeweb gem, v 1.2.3

If soap4r uses Net::HTTP then it should Just Work. I haven't looked at  
soap4r's internals in a long time, but the last time I did it was  
painful. I wouldn't be at all surprised if it just makes socket calls,  
but I also wouldn't be surprised if some require arcana is going on  
which breaks fakeweb - a version of soap4r is in the standard library,  
and installing the gem broke Irb.

I guess I'm saying you'll need to dig into the internals, but I'd try  
it without the soap4r gem too.

Matt

--
   Matt Patterson | Design & Code
   <m...@reprocessed.org> | http://www.reprocessed.org/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Kampmeier  
View profile  
 More options May 31 2009, 6:30 pm
From: Chris Kampmeier <ch...@kampers.net>
Date: Sun, 31 May 2009 15:30:50 -0700 (PDT)
Local: Sun, May 31 2009 6:30 pm
Subject: Re: Fakeweb + soap4r + RSpec
On May 31, 1:37 pm, zilkey <j...@zilkey.com> wrote:

> Is there a way to intercept all HTTP calls from within soap4r?  I'm
> using the soap4r gem, v 1.5.8 and the fakeweb gem, v 1.2.3

I took a look at soap4r's source just now, and it looks like it's
using httpclient, which is an alternative to Net::HTTP. So FakeWeb
won't be able to stub out those requests, since it works by changing
the internals of Net::HTTP.

However! Michael Shapiro has a fork on github that has support for
both Net::HTTP and httpclient. I haven't had time to fully review his
changes, yet, and they're based on an older version of FakeWeb, but
hey -- if you're interested, give it a try and let me know how it
works out. http://github.com/koudelka/fakeweb/commit/f98f40261517a7d80d13b09a13e...

In general, I'd love to get a multi-adapter thing going on. There are
a few really interesting alternatives out there, like curb, typhoeus,
etc.

Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Dean  
View profile  
 More options Jun 1 2009, 12:57 am
From: Jeff Dean <j...@zilkey.com>
Date: Mon, 1 Jun 2009 00:57:09 -0400
Local: Mon, Jun 1 2009 12:57 am
Subject: Re: [fakeweb] Re: Fakeweb + soap4r + RSpec
Awesome - I'll check it out.  Thanks.

On May 31, 2009, at 6:30 PM, Chris Kampmeier wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dr Nic Williams  
View profile  
 More options Jun 1 2009, 1:00 am
From: Dr Nic Williams <dr...@mocra.com>
Date: Mon, 1 Jun 2009 15:00:03 +1000
Local: Mon, Jun 1 2009 1:00 am
Subject: Re: [fakeweb] Re: Fakeweb + soap4r + RSpec

Do we need "One HTTP Adapter To Rule Them All"?

--
Dr Nic Williams
Mocra - Premier iPhone and Ruby on Rails Consultants
w - http://mocra.com
twitter - @drnic
skype - nicwilliams
e - dr...@mocra.com
p - +61 412 002 126 or +61 7 3102 3237

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »