Sha256: 0a285e921887af3daabe0545d20ae93ec4600ca134905cca1f0a85fc73624be3

Contents?: true

Size: 1.91 KB

Versions: 132

Compression:

Stored size: 1.91 KB

Contents

describe KnapsackPro::Runners::Queue::BaseRunner do
  describe '.run' do
    it do
      expect {
        described_class.run(nil)
      }.to raise_error NotImplementedError
    end
  end

  describe '.run_tests' do
    it do
      expect {
        described_class.run_tests(nil, nil, nil, nil)
      }.to raise_error NotImplementedError
    end
  end

  describe 'instance methods' do
    let(:adapter_class) { double }
    let(:runner) do
      described_class.new(adapter_class)
    end
    let(:allocator) { instance_double(KnapsackPro::QueueAllocator) }
    let(:allocator_builder) { instance_double(KnapsackPro::QueueAllocatorBuilder) }

    before do
      expect(KnapsackPro::QueueAllocatorBuilder).to receive(:new).with(adapter_class).and_return(allocator_builder)
      expect(allocator_builder).to receive(:allocator).and_return(allocator)
    end

    describe '#test_file_paths' do
      subject { runner.test_file_paths(args) }

      context 'when can_initialize_queue flag has value' do
        let(:can_initialize_queue) { double }
        let(:executed_test_files) { double }
        let(:args) do
          {
            can_initialize_queue: can_initialize_queue,
            executed_test_files: executed_test_files,
          }
        end
        let(:test_file_paths) { double }

        before do
          expect(allocator).to receive(:test_file_paths).with(can_initialize_queue, executed_test_files).and_return(test_file_paths)
        end

        it { should eq test_file_paths }
      end

      context 'when can_initialize_queue flag has no value' do
        let(:args) { {} }

        it do
          expect { subject }.to raise_error(KeyError)
        end
      end
    end

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

      subject { runner.test_dir }

      before do
        expect(allocator_builder).to receive(:test_dir).and_return(test_dir)
      end

      it { should eq test_dir }
    end
  end
end

Version data entries

132 entries across 132 versions & 1 rubygems

Version Path
knapsack_pro-2.18.1 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.18.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.17.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.16.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.15.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.14.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.13.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.12.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.11.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.10.1 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.10.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.9.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.8.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.7.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.6.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.5.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.4.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.3.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.2.1 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-2.2.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb