On Jul 26, 2010, at 5:12 pm, Bruno Cardoso wrote:
> Not sure if this is a RSpec problem or Rails but I believe is more a
> RSpec situation.
>
> What happens is that when I run my RSpecs tests all the BD is recreated,
>
> ...
>
> Anyone know how to resolve this?
Hi Bruno
Are you running `rake spec` as opposed to the spec command? The default Rails
spec task depends on the "db:test:prepare" task, which bombs your DB. I fixed
this in my project with a file "lib/tasks/rspec_fixes.rake":
class Rake::Task
def overwrite(&block)
@actions.clear
enhance(&block)
end
end
Rake::Task['db:test:prepare'].overwrite do
# We don't want to run migrations or load the schema!!!
end
HTH
Ash
--
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users