Skip to content

Instantly share code, notes, and snippets.

@clupprich
clupprich / tests.watchr
Created August 12, 2011 11:47 — forked from boxedup/tests.watchr
watchr file for Rails with test/unit and turn
ENV["WATCHR"] = "1"
system 'clear'
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
message.gsub!(/\e\[\d+m/, "")
image = message.include?('0 failures, 0 errors') ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)