On 7 Dec 2008, at 19:20, aslak hellesoy wrote:
I respectfully disagree
I respectfully disagree Two reasons:
Firstly, this quickly leads to coupled tests. If test N+1 only
passes if test N cleans up, test N+1 will fail if run in isolation.
I think you misunderstand me. All our cucumber tests automatically
clean up the database after each scenario is run. No chance of nasty
coupling nonsense, but they do all assume that they’ll start with an
Secondly, if each test cleans up after itself, you can’t manually
look at the database to figure out why a test fails - there is no
Good point - I never thought of that!
I just think a cleanup before a run would have to be more
indiscriminate, and therefor slower. Our strategy of keeping a list of
tables touched during a scenario then truncating them in the After do
block has worked very well for us. YMMV of course
rspec-users mailing list