Sha256: 78ba35acc3f42b3762a7a3bbf956c66698ff7e78750cfc8b2a8c62679000c4ab

Contents?: true

Size: 953 Bytes

Versions: 12

Compression:

Stored size: 953 Bytes

Contents

require 'spec_helper'

# rubocop:disable Metrics/BlockLength
RSpec.describe Shoryuken::EnvironmentLoader do
  subject { described_class.new({}) }

  describe '#parse_queues' do
    before do
      # TODO proper test other methods
      allow(subject).to receive(:load_rails).with(anything)
      allow(subject).to receive(:prefix_active_job_queue_names)
      allow(subject).to receive(:require_workers)
      allow(subject).to receive(:validate_queues)
      allow(subject).to receive(:validate_workers)
      allow(subject).to receive(:patch_deprecated_workers)
    end

    it 'parses' do
      Shoryuken.options[:queues] = ['queue_1']
      subject.load

      expect(Shoryuken.queues).to eq(%w(queue_1))
    end

    context 'with priority' do
      it 'parses' do
        Shoryuken.options[:queues] = ['queue_1', ['queue_2', 2]]
        subject.load

        expect(Shoryuken.queues).to eq(%w(queue_1 queue_2 queue_2))
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
shoryuken-3.0.11 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.10 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.9 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.8 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.7 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.6 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.5 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.4 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.3 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.2 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.1 spec/shoryuken/environment_loader_spec.rb
shoryuken-3.0.0 spec/shoryuken/environment_loader_spec.rb