Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

httpclient support #6

Open
nbibler opened this Issue · 5 comments

4 participants

@nbibler

The soap4r gem currently uses httpclient gem which is not currently disabled when used with fakeweb (allow_net_connect = false).

It looks as though some work has been done at http://github.com/dkubb/fakeweb/commit/430bdc3cbed18d38f8a2391053c26e9e2262d671 although it is now a bit out of date.

@nbibler

So, I put together my own patch which adds this support - however - it's certainly not for mainline use as it is specific to httpclient + soap4r at the moment: http://gist.github.com/206226

However, it raised the interesting idea of abstracting the generated Net::HTTPResponse object to fit other libraries. In this case, I had to extend the response to carry status and content methods. It may be more useful to have a custom response object come back through FakeWeb.response_for, in most cases the current Net::HTTP-like object, but for httpclient, for instance, a slightly modified version. If that were available, I wouldn't have had to monkey with Net::HTTPHeader and HTTPClient in this patch.

Just a thought.

@chrisk
Owner

Note to self, httpclient is now on github. http://github.com/nahi/httpclient

@woahdae

implemented the patch in a branch on my fork:

http://github.com/woahdae/fakeweb/commit/a45da6465ec12de5ccf6976e9245fcac8476e07f

working in tests relying on soap4r

@woahdae

(would have sent a pull request, but didn't want to write tests and don't know how to make it generic)

@carlosantoniodasilva

Hey guys, I just runned into the same issue. I need to mock soap4r gem and it uses httpclient. I found this thread, that points to a fork which has the specific changes to fake httpclient, but it seems a bit older (January 05, 2009)..

http://groups.google.com/group/fakeweb-users/browse_thread/thread/7893b121c7c2414f/7309c3b6d7a5fe9c

Do you guys have any news about it?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.