Sha256: 5ebb3e75c1d5a8a9c2367899943587f42bb604972716e2ca5e06f75c8ec58320
Contents?: true
Size: 1.01 KB
Versions: 15
Compression:
Stored size: 1.01 KB
Contents
RSpec.describe Mutant::Parallel::Source::Array do let(:object) { described_class.new(jobs) } let(:job_a) { double('Job A') } let(:job_b) { double('Job B') } let(:job_c) { double('Job B') } let(:jobs) { [job_a, job_b, job_c] } describe '#next' do subject { object.next } context 'when there is a next job' do it 'returns that job' do should be(job_a) end it 'does not return the same job twice' do expect(object.next).to be(job_a) expect(object.next).to be(job_b) expect(object.next).to be(job_c) end end context 'when there is no next job' do let(:jobs) { [] } it 'raises error' do expect { subject }.to raise_error(Mutant::Parallel::Source::NoJobError) end end end describe '#next?' do subject { object.next? } context 'when there is a next job' do it { should be(true) } end context 'when there is no next job' do let(:jobs) { [] } it { should be(false) } end end end
Version data entries
15 entries across 15 versions & 1 rubygems