Re: [rspec-users] Database.truncate_all

2008-12-07 Thread Matt Wynne
On 7 Dec 2008, at 19:20, aslak hellesoy wrote: On Sun, Dec 7, 2008 at 8:07 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: On 7 Dec 2008, at 17:56, Tero Tilus wrote: 2008-12-05 08:32, Jeff Talbot: I want to clear out the database after every run so my tests are isolated. Maybe a minor detail, but

Re: [rspec-users] Database.truncate_all

2008-12-07 Thread aslak hellesoy
On Sun, Dec 7, 2008 at 8:07 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: > On 7 Dec 2008, at 17:56, Tero Tilus wrote: > > 2008-12-05 08:32, Jeff Talbot: >> >>> I want to clear out the database after every run so my tests are >>> isolated. >>> >> >> Maybe a minor detail, but I'd suggest you clear out

Re: [rspec-users] Database.truncate_all

2008-12-07 Thread Matt Wynne
On 7 Dec 2008, at 17:56, Tero Tilus wrote: 2008-12-05 08:32, Jeff Talbot: I want to clear out the database after every run so my tests are isolated. Maybe a minor detail, but I'd suggest you clear out the db _before_ each run. I respectfully disagree :) If I need this done, I can run rake

Re: [rspec-users] Database.truncate_all

2008-12-07 Thread Tero Tilus
2008-12-05 08:32, Jeff Talbot: > I want to clear out the database after every run so my tests are > isolated. Maybe a minor detail, but I'd suggest you clear out the db _before_ each run. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspe

Re: [rspec-users] Database.truncate_all

2008-12-07 Thread Jeff Talbot
Cool. Thanks, guys. On Sat, Dec 6, 2008 at 11:28 AM, Ben Mabey <[EMAIL PROTECTED]> wrote: > Jeff Talbot wrote: >> >> There is a seemingly very useful line of code in the cucumber wiki >> that I'd like to use: >> >> After do >># Scenario teardown >>Database.truncate_all >> end >> >> (from

Re: [rspec-users] Database.truncate_all

2008-12-06 Thread Ben Mabey
Jeff Talbot wrote: There is a seemingly very useful line of code in the cucumber wiki that I'd like to use: After do # Scenario teardown Database.truncate_all end (from http://github.com/aslakhellesoy/cucumber/wikis/migration-from-rspec-stories) But when I run this I get an uninit

Re: [rspec-users] Database.truncate_all

2008-12-06 Thread Mark Wilden
On Sat, Dec 6, 2008 at 2:47 AM, David Salgado <[EMAIL PROTECTED]>wrote: > ISTR that "destroy_all" will instantiate each object, before > destroying it. If you just want to clean the database, I think > "delete_all" is the one you want (it just does a "delete from > [table]", if memory serves), and

Re: [rspec-users] Database.truncate_all

2008-12-06 Thread David Salgado
ISTR that "destroy_all" will instantiate each object, before destroying it. If you just want to clean the database, I think "delete_all" is the one you want (it just does a "delete from [table]", if memory serves), and should be a lot quicker. David 2008/12/6 Mark Wilden <[EMAIL PROTECTED]>: > O

Re: [rspec-users] Database.truncate_all

2008-12-05 Thread Mark Wilden
On Fri, Dec 5, 2008 at 6:32 AM, Jeff Talbot <[EMAIL PROTECTED]> wrote: > There is a seemingly very useful line of code in the cucumber wiki > that I'd like to use: > > After do ># Scenario teardown >Database.truncate_all > end > That's just an example of some code you might call in an A