[rspec-devel] Should all teardown blocks run regardless of error?
aslak.hellesoy at gmail.com
Wed Jun 27 11:10:09 EDT 2007
I was just bitten by some unexpected behaviour. Look at the following spec.
Spec::Runner.configure do |config|
describe "examples and teardowns" do
it "should all run" do
raise "oh no"
I would have expected to see:
But in fact I see:
The last (global) teardown doesn't get run - the first teardown block
raising an error causes the other ones to not be run at all. This
seems inconsistent to me - if an example fails, the (first) teardown
will still run.
I'd like to change this so that all teardowns get run, even if
previous ones fail (likewise for multiple setups). Does anyone have
any objections to that?
More information about the rspec-devel