Sha256: f5f69ba177fdedca1f26aee0a735d060081f3f172c77bbc0948cc2fa6b7b9540

Contents?: true

Size: 1.73 KB

Versions: 31

Compression:

Stored size: 1.73 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(:args) { { can_initialize_queue: can_initialize_queue } }
        let(:test_file_paths) { double }

        before do
          expect(allocator).to receive(:test_file_paths).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

31 entries across 31 versions & 1 rubygems

Version Path
knapsack_pro-0.47.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.46.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.45.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.44.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.43.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.42.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.41.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.40.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.39.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.38.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.37.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.36.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.35.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.34.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.33.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.32.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.31.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.30.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.29.0 spec/knapsack_pro/runners/queue/base_runner_spec.rb
knapsack_pro-0.28.1 spec/knapsack_pro/runners/queue/base_runner_spec.rb