diff options
Diffstat (limited to 'spec/lib/bulk_imports/pipeline/extracted_data_spec.rb')
-rw-r--r-- | spec/lib/bulk_imports/pipeline/extracted_data_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/bulk_imports/pipeline/extracted_data_spec.rb b/spec/lib/bulk_imports/pipeline/extracted_data_spec.rb index 045908de5c4..108ce05cb66 100644 --- a/spec/lib/bulk_imports/pipeline/extracted_data_spec.rb +++ b/spec/lib/bulk_imports/pipeline/extracted_data_spec.rb @@ -50,4 +50,18 @@ RSpec.describe BulkImports::Pipeline::ExtractedData do end end end + + describe '#each_with_index' do + context 'when block is present' do + it 'yields each data item with index' do + expect { |b| subject.each_with_index(&b) }.to yield_control + end + end + + context 'when block is not present' do + it 'returns enumerator' do + expect(subject.each_with_index).to be_instance_of(Enumerator) + end + end + end end |