spec/lib/adapters/rabbitmq_adapter_spec.rb in basquiat-1.3.0.pre.1 vs spec/lib/adapters/rabbitmq_adapter_spec.rb in basquiat-1.3.0

- old
+ new

@@ -1,5 +1,6 @@ +# frozen_string_literal: true require 'spec_helper' require 'basquiat/adapters/rabbitmq_adapter' describe Basquiat::Adapters::RabbitMq do subject(:adapter) { Basquiat::Adapters::RabbitMq.new } @@ -32,21 +33,21 @@ it 'runs the rescue block when an exception happens' do coisa = '' adapter.subscribe_to('some.event', ->(_msg) { fail ArgumentError }) adapter.listen(block: false, rescue_proc: -> (ex, _msg) { coisa = ex.class.to_s }) adapter.publish('some.event', data: 'coisa') - sleep 0.7 + sleep 0.3 expect(coisa).to eq('ArgumentError') end it '#subscribe_to some event' do message = '' adapter.subscribe_to('some.event', ->(msg) { message = msg[:data].upcase }) adapter.listen(block: false) adapter.publish('some.event', data: 'message') - sleep 0.7 + sleep 0.3 expect(message).to eq('MESSAGE') end end @@ -54,10 +55,10 @@ message_received = '' subject.subscribe_to('other.event.#', ->(msg) { message_received = msg[:data].upcase }) subject.listen(block: false) subject.publish('other.event.test', data: 'some stuff') - sleep 0.7 + sleep 0.3 expect(message_received).to eq('SOME STUFF') end end