Permalink
Browse files

Support passing in paths, not just files.

  • Loading branch information...
1 parent 61ebd26 commit 512ec3c27289ed33832cec0ee982e8a986421a6b Dean Strelau committed Mar 23, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/guard/forku.rb
View
@@ -17,7 +17,7 @@ def start
# problems with overlapping DB connections and other wonkiness.
def run_all
%w[unit functional integration performance].each do |test|
- load_in_fork(*Dir.glob("test/#{test}/**/*_test.rb"))
+ load_in_fork("test/#{test}/**/*_test.rb")
Process.wait
end
end
@@ -28,6 +28,11 @@ def run_on_change(paths)
end
def load_in_fork(*paths)
+ paths.collect! {|p|
+ p = File.join(p,'**/*_test.rb') if File.directory?(p)
+ Dir.glob(p)
+ }.flatten!
+
fork do
ActiveRecord::Base.establish_connection if defined?(ActiveRecord::Base)
paths.each {|p| load p }

0 comments on commit 512ec3c

Please sign in to comment.