Skip to content

Instantly share code, notes, and snippets.

@phlipper
Created July 30, 2011 21:21
Show Gist options
  • Save phlipper/1116014 to your computer and use it in GitHub Desktop.
Save phlipper/1116014 to your computer and use it in GitHub Desktop.
it's not pretty, but it's mine
%w[autotest/fsevent autotest/timestamp redgreen/autotest autotest/growl test_notifier/runner/autotest].each do |lib|
begin
require lib
rescue LoadError => e
warn "Couldn't load #{lib}: #{e}"
end
end
TestNotifier.default_notifier = :growl if defined? TestNotifier
if defined? Autotest::Growl
Autotest::Growl::clear_terminal = false
# ~/Library/Autotest should inlcude failed.png, passed.png and pending.png
growl_image_dir = File.join(ENV["HOME"], "Library", "Autotest")
Autotest::Growl::image_dir = growl_image_dir if File.directory? growl_image_dir
end
# skip some paths
Autotest.add_hook :initialize do |autotest|
%w[.git .svn .hg .swp .DS_Store ._* tmp db log tmp vendor rerun.txt Gemfile.lock].each do |exception|
autotest.add_exception(exception)
end
# add mappings for files test files that end in 'test'
autotest.add_mapping %r%^(test)/.*_test.rb$% do |filename, _|
filename
end
autotest.add_mapping %r%^lib/(.*)\.rb$% do |_, match|
["test/#{match[1]}_test.rb"]
end
# option to use for unit_diff
autotest.unit_diff = "cat"
end
class Autotest
# don't rerun the entire suite when fixing broken specs
def rerun_all_tests
end
end
@rxbynerd
Copy link

I can tell this is related to testing, but, what on earth? It looks like it scans an application for tests and runs them.
How far off am I?

Sorry, been awake for the last 17 hours and I'm curious 🍰

@phlipper
Copy link
Author

this is my ~/.autotest file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment