0

I'm using the Handsoap gem with Httpclient gem as the driver in a Rails app.

How can I prevent network calls from Handsaop/Httpclient gems in test cases?

FakeWeb doesn't support Httpclient.

Steve McKinney
  • 3,183
  • 1
  • 23
  • 26

3 Answers3

3

You can use WebMock http://github.com/bblimke/webmock. It has support for Httpclient.

Bartosz Blimke
  • 6,498
  • 3
  • 24
  • 19
1

You can use the mock driver for Handsoap (Handsoap::Http::Drivers::MockDriver). See in the tests for an example.

troelskn
  • 115,121
  • 27
  • 131
  • 155
0

That's right, FakeWeb currently only supports libraries based on Net::HTTP.

Here's a ticket about adding HttpClient support, which also references a couple older forks that attempt to do it.

chrisk
  • 1,663
  • 2
  • 10
  • 10