vendor/plugins/parallel_specs/lib/parallel_specs.rb
#find all specs and partition them into groups
find all specs and partition them into groups
find all specs and partition them into groups
def specs_in_groups(root, num)
    specs = (Dir["#{root}/spec/**/*_spec.rb"]).sort
    groups = []
    num.times{|i| groups[i]=[]}
    loop do
      num.times do |i|
        return groups if specs.empty?
        groups[i] << specs.shift
      end
    end
  end
def specs_in_groups ( root , num ) specs = ( Dir [ "#{root}/spec/**/*_spec.rb" ] ) . sort groups = [ ] num . times { | i | groups [ i ] = [ ] } loop do num . times do | i | return groups if specs . empty? groups [ i ] << specs . shift end end end
find all specs and partition them into groups
find all specs and partition them into groups
root
<not_specific>
num
<not_specific>