[rspec-users] Using the mock framework in story runner

David Chelimsky dchelimsky at gmail.com
Mon Nov 12 16:03:06 EST 2007


On Nov 12, 2007 2:37 PM, Ben Mabey <ben at benmabey.com> wrote:
> Just requiring the lib/specs/mocks.rb doesn't seem to do the trick...
>
>
> Ben Mabey wrote:
> > Hey all,
> > What is the easiest way to include rpec's mocking framework into a story
> > so I can use it?  I want to use it to stub out a Net::HTTP method so I'm
> > not making API calls every time I run my story. :)

I think what you're asking for is more of a stub than a mock - you're
not going to be verifying calls to Net::HTTP, right? We have no plan
to integrate the mocking framework into the story runner. What I'd do
is just write a custom stub of Net::HTTP and include that in your
stories. Although, you may want to have one Story that does make a
real call - just to verify that you've got the protocol right, etc.

HTH,
David

> >
> > Thanks,
> > Ben
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list