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