Created
July 30, 2011 21:21
-
-
Save phlipper/1116014 to your computer and use it in GitHub Desktop.
it's not pretty, but it's mine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 🍰