Using the mock framework in story runner

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. :slight_smile:

Thanks,
Ben

Just requiring the lib/specs/mocks.rb doesn’t seem to do the trick…

On Nov 12, 2007 2:37 PM, Ben M. [email protected] wrote:

Just requiring the lib/specs/mocks.rb doesn’t seem to do the trick…

Ben M. 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. :slight_smile:

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