[rspec-users] stub().and_raise() ain't raising?
jko170 at gmail.com
Thu Jan 12 21:02:23 EST 2012
On Jan 12, 2012, at 5:32 PM, Fearless Fool wrote:
> I have two blocks of tests: one for testing positive outcomes and one
> for testing negative. After poking around, I've concluded that the
> underlying :verify_credentials method is getting called, despite the
> describe 'electricity credentials' do
> before(:each) do
> @wizard.electricity_service = MeteredService::Base.create!()
> it 'with valid credentials should spawn external loader' do
> it 'with invalid credentials should not spawn external loader' do
> can do')
> Am I missing something fundamental about .stub()?
> - ff
> Posted via http://www.ruby-forum.com/.
> rspec-users mailing list
> rspec-users at rubyforge.org
What are the failed expectations? Just paste it.
Are you sure that @wizard.electricity_service is returning the same object on each call? If a database call is being made, there's a good chance it is returning a different object (which has not mocks).
More information about the rspec-users