[rspec-users] Story teardowns?

jesterj a at heitler.com
Fri Feb 22 08:29:50 EST 2008

Andreas Axelsson-2 wrote:
>> > Does the plain text story framework support teardowns? There doesn't
>> seem to
>> > be anywhere to put an "after" method. 
>>For now I'd stick this in a Given that
>> you use at the beginning of each scenario, for example:
>> Given "the stash is in a clean state" do
>>   # yank any old residual gunk here
>> end

Another option, which I found more helpful, is to add another step like:
   And finally, clean up 

Which enables you to do all the teardown in:

 Then "finally, clean up" do{ teardown_stuff }

View this message in context: http://www.nabble.com/Story-teardowns--tp14752945p15633065.html
Sent from the rspec-users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20080222/0b42a14f/attachment.html 

More information about the rspec-users mailing list