[rspec-users] Database.truncate_all

Jeff Talbot jeff.a.talbot at gmail.com
Sun Dec 7 11:51:22 EST 2008


Cool. Thanks, guys.

On Sat, Dec 6, 2008 at 11:28 AM, Ben Mabey <ben at benmabey.com> 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
>> http://github.com/aslakhellesoy/cucumber/wikis/migration-from-rspec-stories)
>>
>> But when I run this I get an uninitialized constant error for "Database".
>>
>> Anybody know if/how I can make this call? Is there something I need to
>> require? Is there a different way of doing this now? I have a need to
>> not use transactional_fixtures for a specific suite of tests and I
>> want to clear out the database after every run so my tests are
>> isolated.
>>
>> Thanks,
>> Jeff
>>
>
> As pointed out this was just an example.  For ideas on how to implement such
> a method you can read this previous thread about it:
> http://www.mail-archive.com/rspec-users@rubyforge.org/msg06597.html
>
> -Ben
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list