[rspec-users] Mocks & Stubs in spec_helper?

s.ross cwdinfo at gmail.com
Fri Mar 9 16:40:00 EST 2007


I have to stub out

   setup do
     request.stub!(:user_agent).and_return('Mozilla')
   end

in each context because my Rails application.rb relies on it (for IE  
reasons).

Is there a way to create mocks or stubs in spec_helper.rb so I don't  
have to repeat this?

Thanks,

Steve


More information about the rspec-users mailing list