Rspec messes up stubs and expectations
Here is an example showing the issue :
before :each do
@car = stub("a car")
@car.stub(:move)
end
it "should be possible to mix stubbing and expectations" do
@car.should_receive(:move).once
2.times { @car.move }
end
This example should obviously fail, but it passes ! Here is a working (failing) version :
before :each do
@car = stub("a car")
end
it "should be possible to mix stubbing and expectations" do
@car.should_receive(:move).once
2.times { @car.move }
end
I am using rspec 1.3.0. Did you fall into the same issues ? Is this fixed in rspec 2 ?
Leave a comment