def test_load(options={})
options = test_configuration(options)
tests = options['tests']
loadpath = options['loadpath']
requires = options['requires']
live = options['live']
exclude = options['exclude']
files = Dir.multiglob_r(*tests) - Dir.multiglob_r(*exclude)
return puts("No tests.") if files.empty?
max = files.collect{ |f| f.size }.max
list = []
files.each do |f|
next unless File.file?(f)
if r = system("ruby -I#{loadpath.join(':')} #{f} > /dev/null 2>&1")
puts "%-#{max}s [PASS]" % [f]
else
puts "%-#{max}s [FAIL]" % [f]
list << f
end
end
puts " #{list.size} Load Failures"
if verbose?
unless list.empty?
puts "\n-- Load Failures --\n"
list.each do |f|
print "* "
system "ruby -I#{loadpath} #{f} 2>&1"
end
puts
end
end
end