[rspec-users] spec:models depends on development db:migration

Scott Taylor mailing_lists at railsnewbie.com
Sun Oct 21 17:41:40 EDT 2007


On Oct 21, 2007, at 3:35 PM, Bryan Helmkamp wrote:

> On 10/18/07, Keith McDonnell <keith at dancingtext.com> wrote:
>> rake spec:models seems to clone the test database from  
>> development. If
>> your dev db is empty, the models task fails mysteriously.
>>
>> Anyway, to make sure your dev db is at the current migration  
>> version, I
>> added this dependency in lib/tasks
>>
>> task 'spec:models' => 'db:migrate'
>>
>> Now the dev db is migrated up with each test pass.
>
> In my projects I actually go out of my way to remove the DB clone task
> as a dependency for spec tasks. The reason is pure speed. It shaves a
> few seconds off every run at the expense of having to manually run
> RAILS_ENV=test rake db:migrate after schema changes.
>
> Perhaps we should consider a change to remove the dependency in RSpec
> core but provide specific error messaging should the problem occur.
> And it would be simple enough to have the db:migrate rake task migrate
> both the dev and test databases should they exist.
>
> WDYT?

How are in-memory databases (sqlite3) going to work with that?

Scott



More information about the rspec-users mailing list