Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Autotest mapping file
Autotest.add_hook :initialize do |at|
# Ignore these files
%w{
.hg .git .svn stories tmtags Rakefile Capfile README .html
spec/spec.opts spec/rcov.opts vendor/gems autotest svn-commit .DS_Store
}.each {|exception|at.add_exception(exception)}
# Map concerned_with files properly.
# app/models/[model]/[concern].rb should map to
# test/unit/[model]/[concern]_test.rb
at.add_mapping(/app\/models\/[a-z_]*\/.*\.rb/) do |f, _|
at.files_matching(/test\/unit\/$1\/$2_test\.rb/)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment