Skip to content

Instantly share code, notes, and snippets.

@subimage
Created February 8, 2013 20:48
Show Gist options
  • Save subimage/4741805 to your computer and use it in GitHub Desktop.
Save subimage/4741805 to your computer and use it in GitHub Desktop.
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