Sha256: 369ac25807ec21eb21779069668f2fab0119adf28904cf451f6ca9311312c0aa

Contents?: true

Size: 802 Bytes

Versions: 18

Compression:

Stored size: 802 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.split('/').first
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
knapsack-4.0.0 lib/knapsack/allocator.rb
knapsack-3.1.0 lib/knapsack/allocator.rb
knapsack-3.0.0 lib/knapsack/allocator.rb
knapsack-2.0.0 lib/knapsack/allocator.rb
knapsack-1.22.0 lib/knapsack/allocator.rb
knapsack-1.21.1 lib/knapsack/allocator.rb
knapsack-1.21.0 lib/knapsack/allocator.rb
knapsack-1.20.0 lib/knapsack/allocator.rb
knapsack-1.19.0 lib/knapsack/allocator.rb
knapsack-1.18.0 lib/knapsack/allocator.rb
knapsack-1.17.2 lib/knapsack/allocator.rb
knapsack-1.17.1 lib/knapsack/allocator.rb
knapsack-1.17.0 lib/knapsack/allocator.rb
knapsack-1.16.0 lib/knapsack/allocator.rb
knapsack-1.15.0 lib/knapsack/allocator.rb
knapsack-1.14.1 lib/knapsack/allocator.rb
knapsack-1.14.0 lib/knapsack/allocator.rb
knapsack-1.13.3 lib/knapsack/allocator.rb