Sha256: b4cefff194f5c1a748f48abe67eb995b0fa2f4420cc6806310744a9ea6cffaeb

Contents?: true

Size: 1.87 KB

Versions: 188

Compression:

Stored size: 1.87 KB

Contents

describe KnapsackPro::TestFlatDistributor do
  let(:test_flat_distributor) { described_class.new(test_files, node_total) }
  let(:node_total) { 2 }
  let(:test_files) do
    [
      { 'path' => 'spec/dir1/a_spec.rb' },
      { 'path' => 'spec/dir2/a_spec.rb' },
      { 'path' => 'spec/dir3/a_spec.rb' },
      { 'path' => 'spec/feature/e_spec.rb' },
      { 'path' => 'spec/models/b_spec.rb' },
      { 'path' => 'spec/feature/c_spec.rb' },
      { 'path' => 'spec/models/d_spec.rb' },
      { 'path' => 'spec/feature/a_spec.rb' },
      { 'path' => 'spec/models/f_spec.rb' },
      { 'path' => 'spec/models/g_spec.rb' },
      { 'path' => 'spec/dir4/h_spec.rb' },
      { 'path' => 'spec/models/i_spec.rb' },
    ]
  end

  describe '#nodes' do
    subject { test_flat_distributor.nodes }

    it do
      should eq({
        0 => [
          { 'path' => 'spec/feature/a_spec.rb' },
          { 'path' => 'spec/feature/e_spec.rb' },
          { 'path' => 'spec/models/d_spec.rb' },
          { 'path' => 'spec/models/g_spec.rb' },
          { 'path' => 'spec/dir1/a_spec.rb' },
          { 'path' => 'spec/dir3/a_spec.rb' },
        ],
        1 => [
          { 'path' => 'spec/feature/c_spec.rb' },
          { 'path' => 'spec/models/b_spec.rb' },
          { 'path' => 'spec/models/f_spec.rb' },
          { 'path' => 'spec/models/i_spec.rb' },
          { 'path' => 'spec/dir2/a_spec.rb' },
          { 'path' => 'spec/dir4/h_spec.rb' },
        ],
      })
    end
  end

  describe '#test_files_for_node' do
    subject { test_flat_distributor.test_files_for_node(1) }

    it do
      should eq([
        { 'path' => 'spec/feature/c_spec.rb' },
        { 'path' => 'spec/models/b_spec.rb' },
        { 'path' => 'spec/models/f_spec.rb' },
        { 'path' => 'spec/models/i_spec.rb' },
        { 'path' => 'spec/dir2/a_spec.rb' },
        { 'path' => 'spec/dir4/h_spec.rb' },
      ])
    end
  end
end

Version data entries

188 entries across 188 versions & 1 rubygems

Version Path
knapsack_pro-7.13.0 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.12.1 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.12.0 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.11.0 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.10.0 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.9.0 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.8.2 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.8.1 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.8.0 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.7.0 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.6.2 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.6.1 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.6.0 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.1.0 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.0.1 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-7.0.0 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-6.0.4 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-6.0.3 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-6.0.2 spec/knapsack_pro/test_flat_distributor_spec.rb
knapsack_pro-6.0.1 spec/knapsack_pro/test_flat_distributor_spec.rb