Sha256: 9a4c6d40a5da80f5f03d124efcfe62cfaa6dc3bb8786d04a0a4b4aaf1aaa563d

Contents?: true

Size: 808 Bytes

Versions: 1

Compression:

Stored size: 808 Bytes

Contents

module Knapsack
  class Allocator
    def initialize(args={})
      @report_distributor = Knapsack::Distributors::ReportDistributor.new(args)
      @leftover_distributor = Knapsack::Distributors::LeftoverDistributor.new(args)
    end

    def report_node_tests
      @report_node_tests ||= @report_distributor.tests_for_current_node
    end

    def leftover_node_tests
      @leftover_node_tests ||= @leftover_distributor.tests_for_current_node
    end

    def node_tests
      @node_tests ||= report_node_tests + leftover_node_tests
    end

    def stringify_node_tests
      node_tests
      .map do |test_file|
        %{"#{test_file}"}
      end.join(' ')
    end

    def test_dir
      Knapsack::Config::Env.test_dir || @report_distributor.test_file_pattern.gsub(/^(.*?)\//).first
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
knapsack-1.13.2 lib/knapsack/allocator.rb