Skip to content

Commit 18f48be

Browse files
committed
Add an alias that reads well when used with non-default batch size.
1 parent 92fd8b2 commit 18f48be

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

ruby_event_store/lib/ruby_event_store/specification.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def each
8888
def in_batches(batch_size = DEFAULT_BATCH_SIZE)
8989
Specification.new(repository, mapper, result.dup.tap { |r| r.batch_size = batch_size })
9090
end
91+
alias :in_batches_of :in_batches
9192

9293
private
9394
attr_reader :repository, :mapper

ruby_event_store/spec/specification_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ module RubyEventStore
279279
end
280280
end
281281

282+
specify do
283+
expect(specification.in_batches_of.result).to eq(specification.in_batches.result)
284+
expect(specification.in_batches_of(1000).result).to eq(specification.in_batches(1000).result)
285+
end
286+
282287
let(:repository) { InMemoryRepository.new }
283288
let(:mapper) { Mappers::Default.new }
284289
let(:specification) { Specification.new(repository, mapper) }

0 commit comments

Comments
 (0)