Skip to content

Instantly share code, notes, and snippets.

@aaronjensen
Created February 8, 2011 03:09
Show Gist options
  • Save aaronjensen/815776 to your computer and use it in GitHub Desktop.
Save aaronjensen/815776 to your computer and use it in GitHub Desktop.
Autotest.add_hook(:initialize) {|at|
%w{.git .svn .hg .swp .DS_Store ._* tmp}.each do |exception|
at.add_exception(exception)
end
at.clear_mappings # take out the default (test/test*rb)
at.add_mapping(%r%^(spec|third_party)/.*_spec.rb$%) { |filename, _|
filename
}
at.add_mapping(%r%^app/(.*)\.rb$%) { |_, m|
["spec/#{m[1]}_spec.rb"]
}
at.add_mapping(%r%^spec/(spec_helper|shared/.*)\.rb$%) {
at.files_matching %r%^(spec|third_party)/.*_spec\.rb$%
}
#nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment