Skip to content

Commit

Permalink
Revert "Now with more growl."
Browse files Browse the repository at this point in the history
This reverts commit 494dcef.
  • Loading branch information
Dean Strelau committed Mar 23, 2011
1 parent 494dcef commit 5071865
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions lib/guard/forku.rb
Expand Up @@ -5,9 +5,10 @@ module Guard
class Forku < Guard

def start
UI.info "Loading test_helper"
require 'test_helper'
ActiveRecord::Base.connection.disconnect! if defined?(ActiveRecord::Base)
notify 'Ready to test. Code away.'
UI.info "Ready"
end

# Called on Ctrl-/ signal
Expand All @@ -17,6 +18,7 @@ def start
def run_all
%w[unit functional integration performance].each do |test|
load_in_fork("test/#{test}/**/*_test.rb")
Process.wait
end
end

Expand All @@ -35,27 +37,14 @@ def load_in_fork(*paths)
ActiveRecord::Base.establish_connection if defined?(ActiveRecord::Base)
$0 = paths.join(' ') # test/unit uses this
if paths.empty?
notify "No tests found", image: :pending
UI.info "No tests found. Skipping."
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

0 comments on commit 5071865

Please sign in to comment.