Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Now with more growl.

  • Loading branch information...
commit 494dcef289b056385eb0e46e3004009e7671fd3d 1 parent 9f4114d
Dean Strelau authored
Showing with 15 additions and 4 deletions.
  1. +15 −4 lib/guard/forku.rb
View
19 lib/guard/forku.rb
@@ -5,10 +5,9 @@ module Guard
class Forku < Guard
def start
- UI.info "Loading test_helper"
require 'test_helper'
ActiveRecord::Base.connection.disconnect! if defined?(ActiveRecord::Base)
- UI.info "Ready"
+ notify 'Ready to test. Code away.'
end
# Called on Ctrl-/ signal
@@ -18,7 +17,6 @@ def start
def run_all
%w[unit functional integration performance].each do |test|
load_in_fork("test/#{test}/**/*_test.rb")
- Process.wait
end
end
@@ -37,14 +35,27 @@ def load_in_fork(*paths)
ActiveRecord::Base.establish_connection if defined?(ActiveRecord::Base)
$0 = paths.join(' ') # test/unit uses this
if paths.empty?
- UI.info "No tests found. Skipping."
+ notify "No tests found", image: :pending
exit! # skip test/unit autorun
else
paths.each {|p| load p }
end
end
+ if Process.wait > 0
+ notify "PASS"
+ else
+ notify "FAIL", image: :failed
+ end
end
private :load_in_fork
+
+ def notify(message, opts={})
+ if options[:notify]
+ Notifier.notify(message, opts)
+ else
+ UI.info("*** " << message)
+ end
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.