Sha256: 8632b1430bd03b2832078e6775028f2fcf7b8532748abbdc7742158dc2910fce

Contents?: true

Size: 688 Bytes

Versions: 2

Compression:

Stored size: 688 Bytes

Contents

module Borg
  class TestUnit
    include AbstractAdapter

    def run(n = 3)
      redirect_stdout()
      load_environment('test')
      remove_file_groups_from_redis('tests',n) do |index,test_files|
        prepare_databse(index) unless try_migration_first(index)
        test_files.split(',').each do |fl|
          load(Rails.root.to_s + fl)
        end
      end
    end

    def add_to_redis(worker_count)
      test_files = (Dir["#{Rails.root}/test/unit/**/**_test.rb"] + Dir["#{Rails.root}/test/functional/**/**_test.rb"]).map do |fl|
        fl.gsub(/#{Rails.root}/,'')
      end.sort.in_groups(worker_count, false)
      add_files_to_redis(test_files,'tests')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
borg-0.0.8 lib/borg/borg_test_unit.rb
borg-0.0.7 lib/borg/borg_test_unit.rb