Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v0.0.2
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 25 lines (21 sloc) 0.525 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
def growl(message)
  growlnotify = `which growlnotify`.chomp
  title = "Watchr Test Results"
  passed = message.include?('0 failures, 0 errors')
  severity = passed ? "-1" : "1"
  options = "-w -n Watchr"
  options << " -m '#{message}' '#{title}' -p #{severity}"
  system %(#{growlnotify} #{options} &)
end

def run_all_tests
  system('clear')
  result = `rake test`
  growl result.split("\n")[-3] rescue nil
  puts result
end

watch("test/derp_test\.rb") do
  run_all_tests
end

watch("lib/derp\.rb") do
  run_all_tests
end
Something went wrong with that request. Please try again.