For the record We have an application related to our production base, we use the data to enter the system and from there we exit the test database.
The last thing we wanted was to clear the rails or the database schema when running the rspec / unit tests.
use the information, here is this question here: Is it possible to get a list of all available rake tasks in the namespace?
I was able to come up with the following solution:
Rake.application.in_namespace(:db){|x| x.tasks.map{|t| Rake.application.instance_variable_get('@tasks').delete(t.name) } }
This is placed at the end of our Rakefile, which allowed us to remove all db: rake tasks, as can be seen here:
[ davidc@david-macbookp app1{master}]$ rake -T db [ davidc@david-macbookp app1{master}]$
With a little tweaking, this can be done to shutdown based on the environment.
Update:
A warning word doing this for the db namespace broke testunit and addison needed to be added:
namespace :db do task 'test:prepare' do end end
source share