spec/utils/db_producer_spec.rb in deimos-kafka-1.0.0.pre.beta20 vs spec/utils/db_producer_spec.rb in deimos-kafka-1.0.0.pre.beta21
- old
+ new
@@ -58,9 +58,13 @@
by: 1000).once
producer.produce_messages(batch)
end
it 'should split the batch size on buffer overflow' do
+ class_producer = double(Phobos::Producer::ClassMethods::PublicAPI, # rubocop:disable RSpec/VerifiedDoubles
+ sync_producer_shutdown: nil)
+ allow(producer.class).to receive(:producer).and_return(class_producer)
+ expect(class_producer).to receive(:sync_producer_shutdown).twice
count = 0
allow(phobos_producer).to receive(:publish_list) do
count += 1
raise Kafka::BufferOverflow if count < 3
end