rake problem -- overriding test task

I’ve got a test suite that runs fine from the command line but fails from rake. We’ve got a database table in our app that causes db:test:clone to fail. From the command line, db:test:clone_structure works ok, so I tried to override db:test:clone in the Rakefile. When I ‘rake test’, the unit tests run successfully, but the integration tests all fail (they all run successfully from the command line). I’ll copy the Rakefile below. If anybody’s got any ideas about what I might be doing wrong, I’d really appreciate hearing them.



======== Rakefile =========

require(File.join(File.dirname(FILE), ‘config’, ‘boot’))

require ‘rake’ require ‘rake/testtask’ require ‘rake/rdoctask’ require ‘tasks/rails’

don’t clone the test database; use clone_structure

so Rake doesn’t abort on the fulltext index

Rake::TaskManager.class_eval do def delete_task(task_name) @tasks.delete(task_name.to_s) end Rake.application.delete_task(“db:test:clone”) end namespace :db do namespace :test do task :clone do Rake::Task[“db:test:clone_structure”].invoke


end end