Sha256: 7af849a0155ae644802291db0ae60ac2d26b3c0a19662a520fe3d43055167e5d

Contents?: true

Size: 1.53 KB

Versions: 87

Compression:

Stored size: 1.53 KB

Contents

describe KnapsackPro::QueueAllocatorBuilder do
  let(:adapter_class) { KnapsackPro::Adapters::BaseAdapter }
  let(:allocator_builder) { described_class.new(adapter_class) }

  describe '#allocator' do
    let(:allocator) { double }

    subject { allocator_builder.allocator }

    before do
      fast_and_slow_test_files_to_run = double
      expect(allocator_builder).to receive(:fast_and_slow_test_files_to_run).and_return(fast_and_slow_test_files_to_run)

      fallback_mode_test_files = double
      expect(allocator_builder).to receive(:fallback_mode_test_files).and_return(fallback_mode_test_files)

      repository_adapter = double
      expect(KnapsackPro::RepositoryAdapterInitiator).to receive(:call).and_return(repository_adapter)

      ci_node_total = double
      expect(KnapsackPro::Config::Env).to receive(:ci_node_total).and_return(ci_node_total)
      ci_node_index = double
      expect(KnapsackPro::Config::Env).to receive(:ci_node_index).and_return(ci_node_index)
      ci_node_build_id = double
      expect(KnapsackPro::Config::Env).to receive(:ci_node_build_id).and_return(ci_node_build_id)

      expect(KnapsackPro::QueueAllocator).to receive(:new).with(
        fast_and_slow_test_files_to_run: fast_and_slow_test_files_to_run,
        fallback_mode_test_files: fallback_mode_test_files,
        ci_node_total: ci_node_total,
        ci_node_index: ci_node_index,
        ci_node_build_id: ci_node_build_id,
        repository_adapter: repository_adapter,
      ).and_return(allocator)
    end

    it { should eq allocator }
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
knapsack_pro-6.0.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.7.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.6.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.5.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.4.1 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.4.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.3.5 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.3.4 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.3.3 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.3.2 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.3.1 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.3.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.2.1 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.2.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.1.2 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.1.1 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.1.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-5.0.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-4.1.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-4.0.0 spec/knapsack_pro/queue_allocator_builder_spec.rb