Skip to content

Instantly share code, notes, and snippets.

@JonRowe
Created January 14, 2011 15:40
Show Gist options
  • Save JonRowe/779753 to your computer and use it in GitHub Desktop.
Save JonRowe/779753 to your computer and use it in GitHub Desktop.
A generic rails .autotest mappings file
egin
require 'autotest/fsevent'
rescue LoadError
end
Autotest.add_hook :initialize do |at|
at.add_mapping(/^spec\/**\/*_spec\.rb$/, true){ |filename, _|
filename
}
at.add_mapping(/^spec\/support\/.*\.rb$/, true) { |_, _|
Dir['spec/**/*_spec.rb']
}
at.add_mapping(/^app\/(.*)\.rb$/, true) { |_, m|
Dir["spec/#{m[1]}_spec.rb"]
}
nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment