Sha256: bfac16cfdfcc30d857c73cd02c2784384de242864e9dd9861563d2a7ce38c541

Contents?: true

Size: 526 Bytes

Versions: 35

Compression:

Stored size: 526 Bytes

Contents

RSpec.shared_examples 'a job backend' do
  class TestJob
    def perform(x, y); end
  end

  let(:job) { TestJob.new }
  let(:x) { 123 }
  let(:y) { 'hello' }

  before do
    allow(TestJob).to receive(:new).and_return(job)
    allow(job).to receive(:perform).and_call_original
    described_class.new.enqueue('test_queue', TestJob, x, y)
  end

  describe '#enqueue' do
    it 'should execute jobs with a #perform method with the passed arguments' do
      expect(job).to have_received(:perform).with(x, y)
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
routemaster-drain-3.7.1 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.7.0 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.6.8 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.6.7 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.6.6 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.6.5 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.6.4 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.6.3 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.6.2 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.6.1 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.6.0 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.5.1 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.5.0 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.4.0 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.3.0 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.2.0 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.1.0 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.0.3 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.0.2 spec/routemaster/jobs/backends/backend_examples.rb
routemaster-drain-3.0.1 spec/routemaster/jobs/backends/backend_examples.rb