[rspec-users] Stopping example execution?

Britt Mileshosky mileshosky at hotmail.com
Sat Jun 28 18:57:36 EDT 2008

Hello, I'm wondering If I am missing something here when creating an example that sets an expecation at the top or beginning of an action but requires you to stub / mock everything that follows.

I want to test that a certain controller is running a before_filter...thats easy:

- controller.should_receive(:require_user)
- do_get

But now i've got to mock / stub everything else that comes behind this filter so that I don't receive 'unexpected method' errors, or other blowups because I am requesting the whole action.  Is there anyway to stop execution after an expectation has been met? It seems to me that this might clean things up a bit.  Not sure, I'm still fairly new to BDD/Mocking by about 2 weeks.

Need to know now? Get instant answers with Windows Live Messenger.

More information about the rspec-users mailing list