[rspec-users] anyone able to explain logic behind "rake spec" startup (e.g. db:test:prepare => abort_if_pending_migration => invoke environment => etc etc)
Greg Hauptmann
greg.hauptmann.ruby at gmail.com
Thu Nov 6 16:07:39 EST 2008
I'm still a bit confused - I'll try to be more specific in questions:
* rake db:test:prepare - Check for pending migrations and load the test schema
==> Q1. DOES NOT RUN IN PENDING MIGRATIONS TO TEST DATABASE?
==> Q2. RE TEST SCHEMA - ARE THE MIGRATIONS USE TO CREATE THE
DATABASE OR THE DEVELOPMENT SCHEMA FILE???
==> Q3. WHY DOES IT HAVE TO BE CALLED MORE THAN ONCE?
* rake db:test:load - Recreate the test database from the current schema.rb
==> Q4. WHY DO WE NEED TO LOAD FROM THE SCHEMA RATHER THAN
MIGRATIONS? IS IT TO AVOID ANY DATA BEING LOADED BY MIGRATIONS FOR
THE TEST DATABASE?
==> Q5. WHY IS IT RUN MULTIPLE TIMES?
* rake db:test:purge - Empty the test database
=> Q6. WHY IS IT RUN MULTIPLE TIMES?
=> Q7. DOES IT DROP TABLES ALSO?
tks
Confused :)
On Fri, Nov 7, 2008 at 2:07 AM, Mark Wilden <mark at mwilden.com> wrote:
> On Thu, Nov 6, 2008 at 7:31 AM, Matt Wynne <matt at mattwynne.net> wrote:
>
>>
>> If you want to speed things up, just run spec spec. That will work fine
>> unless you have pending migrations that affect your specs.
>
> Or if you have migrations that were applied to the dev db, but you haven't
> run db:test:prepare yet. I still get bitten by that.
>
> ///ark
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
More information about the rspec-users
mailing list