hehe, tbh even if the documentation had been there i probably wouldn't have read it :)<br><br>thanks!<br><br><div><span class="gmail_quote">On 26/02/2008, <b class="gmail_sendername">David Chelimsky</b> <<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, Feb 26, 2008 at 8:08 AM, Max Williams<br> <br><<a href="mailto:toastkid.williams@gmail.com">toastkid.williams@gmail.com</a>> wrote:<br> ><br> ><br> ><br> > On 26/02/2008, David Chelimsky <<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>> wrote:<br>
> ><br> > > On Tue, Feb 26, 2008 at 7:39 AM, Max Williams<br> > > <<a href="mailto:toastkid.williams@gmail.com">toastkid.williams@gmail.com</a>> wrote:<br> > ><br> > ><br> > ><br>
> > This does not happen for you implicitly when you use before(:all)<br> > > because there is no mechanism for running a group of examples in a<br> > > transaction.<br> ><br> > ah...i see. I didn't know about that last bit. :)<br>
<br> <br>FYI: <a href="http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/310">http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/310</a><br> <br> Cheers,<br> <br>David<br> <br><br> ><br> > > > My problem, though, is that the data is left over from the last time (in<br>
> > > fact all previous times) that i ran the spec file, where i thought that<br> > it<br> > > > was cleared out. Do i need to explicitly tell the database to clear all<br> > the<br> > > > records in an 'after' block?<br>
> ><br> > ><br> > > Yes. If you want to use before(:all) to set up data, you need to use<br> > > after(:all) to clean it up explicitly.<br> > ><br> > > Please beware that this approach is extremely error prone over time.<br>
> > If you ever introduce a side effect (intentionally or accidentally)<br> > > that modifies the data, you're going to look at the spec, see the data<br> > > you're setting up and incorrectly think that that's the data every<br>
> > example is using. It is much, much safer (and more sane) to use<br> > > before(:each) even though it may slow things down a bit.<br> ><br> > Gotcha. Thanks!<br> ><br> > > HTH,<br> > ><br>
> > David<br> > ><br> > ><br> > ><br> ><br> ><br> <br>> _______________________________________________<br> > rspec-users mailing list<br> > <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
> <a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br> ><br> _______________________________________________<br> rspec-users mailing list<br> <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br> </blockquote></div><br>