Sha256: 977cd92334ac3a6a2f847b9f9eef53617e2d4c3de4fdb831c849f31565d89b20

Contents?: true

Size: 1.39 KB

Versions: 71

Compression:

Stored size: 1.39 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
      test_file_pattern = double
      expect(KnapsackPro::TestFilePattern).to receive(:call).with(adapter_class).and_return(test_file_pattern)

      test_files = double
      expect(KnapsackPro::TestFileFinder).to receive(:call).with(test_file_pattern).and_return(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(
        test_files: 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

71 entries across 71 versions & 1 rubygems

Version Path
knapsack_pro-1.18.2 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.18.1 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.18.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.17.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.16.1 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.16.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.15.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.14.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.13.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.12.1 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.12.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.11.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.10.1 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.10.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.9.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.8.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.7.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.6.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.5.0 spec/knapsack_pro/queue_allocator_builder_spec.rb
knapsack_pro-1.4.0 spec/knapsack_pro/queue_allocator_builder_spec.rb