Skip to content

Instantly share code, notes, and snippets.

@icantrap
Created July 27, 2010 08:51
Show Gist options
  • Save icantrap/491954 to your computer and use it in GitHub Desktop.
Save icantrap/491954 to your computer and use it in GitHub Desktop.
Autotest init hook - rerun all when new test db is created
Autotest.add_hook :initialize do |autotest|
# remove the exceptions added by autotest-rails, then readd them w/o test.sqlite3
autotest.remove_exception %r%^\./(?:db|doc|log|public|script|tmp|vendor)%
autotest.add_exception %r%^\./(?:doc|log|public|script|tmp|vendor)%
autotest.add_exception %r%^\./db/(?:migrate|(development\.sqlite3|.*\.rb)$)%
autotest.add_mapping %r%^db/test.sqlite3$% do |filename, match_data|
autotest.files_matching %r%^test/(unit|controllers|views|functional)/.*_test\.rb$%
end
false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment