-
-
Save apsoto/1310692 to your computer and use it in GitHub Desktop.
~/autotest config file
This file contains 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
#autotest configuration | |
# | |
require 'redgreen/autotest' | |
require 'autotest/timestamp' | |
# #################### | |
# GROWL CONFIG | |
# #################### | |
#http://github.com/svoop/autotest-growl/tree/master | |
require 'autotest/growl' | |
#Autotest::Growl::hide_label = true | |
#Autotest::Growl::show_modified_files = true | |
#Autotest::Growl::clear_terminal = false | |
#Autotest::Growl::one_notification_per_run = true | |
#Autotest::Growl::remote_notification = true | |
# #################### | |
# MAC-FRIENDLY | |
# #################### | |
# see: http://www.bitcetera.com/en/techblog/2009/05/27/mac-friendly-autotest/ | |
require 'autotest/fsevent' | |
# #################### | |
# SCOPE LIMITING | |
# #################### | |
Autotest.add_hook :initialize do |at| | |
# # Limit the scope of autotest (see: http://blog.davidchelimsky.net/articles/2008/03/05/limiting-scope-of-autotest) | |
# # Usage: | |
# # autotest app/models app/lib test/unit/notices | |
# # -> watch app/models, app/lib and test/unit/notices | |
unless ARGV.empty? | |
at.find_directories = ARGV.dup | |
end | |
end | |
# #################### | |
# EXCLUDE SOME FILES | |
# #################### | |
Autotest.add_hook :initialize do |autotest| | |
%w{.git .svn .hg .DS_Store *.log ._* vendor}.each {|exception| autotest.add_exception(exception) } | |
false | |
end | |
# #################### | |
# SPEAK (whisper) | |
# #################### | |
Autotest.add_hook :ran_command do |at| | |
results = [at.results].flatten.join("\n") | |
# output = results.slice(/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+pending)?/) | |
# aravet: the above line seems to be for rspec only. the one below works with TestUnit | |
if output = results.slice(/(\d+) assertions, (\d+) failures, (\d+) errors/) | |
failed = $~[2].to_i > 0 || $~[3].to_i > 0 | |
system "say -v Whisper \"#{failed ? "No" : "Yes"}\"" #aravet | |
else | |
system "say -v Whisper \"AUTOTEST ERROR (see ~/.autotest)\"" | |
puts "\n\nAutotest error -erroOOr : results = \n#{results}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment