ActiveResource Mock Objects

Some of my tests use ActiveResource HttpMock requests and some of them
do not. Does anyone know if there is a way to disable the HttpMocks
after they have already been loaded? The method
ActiveResource::HttpMock.reset! only removes all the objects, but
ActiveResource still thinks it should look for mock requests rather
than actually making requests. I hope this makes sense!

Thanks,
Tom

A little more information: the problem is once you require
‘active_resource/http_mock’ all subsequent tests will assume http
mocks exists. This makes it so I can’t run my tests with rake.

No response? Is anyone using HttpMock?

Thanks,
Tom

I haven’t used HttpMock, but I’ve used Fakeweb
(http://fakeweb.rubyforge.org/) and that will let you setup and reset
the registry pretty easily:

FakeWeb.clean_registry

On May 17, 2010, at 3:52 PM, TomRossi7 wrote:

No response? Is anyone using HttpMock?

Thanks,
Tom


Zach M.