I''m trying to set up testing on my ActiveResource project. The HttpMock appears to be what I want, but whenever I use the code in the "documentation", I get the error NameError: uninitialized constant ActiveResource::HttpMock Is there something I need to do to enable HttpMock testing? Thanks, Tom
I''ve never used HttpMock for testing, but I''d recommend checking out Fakeweb (http://fakeweb.rubyforge.org/) for testing against external resource. I use it for ActiveResource calls and for hitting other external APIs. Hope that helps. On Wed, Jun 24, 2009 at 2:37 PM, TomRossi7 <tom-5bxIUPmzHicFraO2wh7vUA@public.gmane.org> wrote:> > I''m trying to set up testing on my ActiveResource project. The > HttpMock appears to be what I want, but whenever I use the code in the > "documentation", I get the error > > NameError: uninitialized constant ActiveResource::HttpMock > > Is there something I need to do to enable HttpMock testing? > > Thanks, > Tom > > >-- Christopher Warren christopher.warren-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 612.424.9880 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Wed, Jun 24, 2009 at 2:37 PM, TomRossi7<tom-5bxIUPmzHicFraO2wh7vUA@public.gmane.org> wrote:> > I''m trying to set up testing on my ActiveResource project. The > HttpMock appears to be what I want, but whenever I use the code in the > "documentation", I get the error > > NameError: uninitialized constant ActiveResource::HttpMock > > Is there something I need to do to enable HttpMock testing?require ''active_resource/http_mock'' first ;) jeremy
Oh wow. That was easy. Thanks Jeremy! p.s. Did you find that documented somewhere? On Jun 24, 8:40 pm, Jeremy Kemper <jer...-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org> wrote:> On Wed, Jun 24, 2009 at 2:37 PM, TomRossi7<t...-5bxIUPmzHicFraO2wh7vUA@public.gmane.org> wrote: > > > I''m trying to set up testing on my ActiveResource project. The > > HttpMock appears to be what I want, but whenever I use the code in the > > "documentation", I get the error > > > NameError: uninitialized constant ActiveResource::HttpMock > > > Is there something I need to do to enable HttpMock testing? > > require ''active_resource/http_mock'' first ;) > > jeremy