spec/integration/bunny/amqp_integration_spec.rb in message-driver-0.6.1 vs spec/integration/bunny/amqp_integration_spec.rb in message-driver-0.7.0

- old
+ new

@@ -4,15 +4,17 @@ let!(:broker) { MessageDriver::Broker.configure BrokerConfig.config } context "when a queue can't be found" do let(:queue_name) { 'my.lost.queue' } it 'raises a MessageDriver::QueueNotFound error' do + # rubocop:disable Style/MultilineBlockChain expect do broker.dynamic_destination(queue_name, passive: true) end.to raise_error(MessageDriver::QueueNotFound) do |err| expect(err.nested).to be_a Bunny::NotFound end + # rubocop:enable end end context 'when a channel level exception occurs' do it 'raises a MessageDriver::WrappedError error' do @@ -52,21 +54,21 @@ it 'rolls back the transaction' do expect do MessageDriver::Client.with_message_transaction do destination.publish('Test Message') - fail 'unhandled error' + raise 'unhandled error' end end.to raise_error 'unhandled error' expect(destination.pop_message).to be_nil end it 'allows the next transaction to continue' do expect do MessageDriver::Client.with_message_transaction do destination.publish('Test Message 1') - fail 'unhandled error' + raise 'unhandled error' end end.to raise_error 'unhandled error' expect(destination.pop_message).to be_nil MessageDriver::Client.with_message_transaction do @@ -81,19 +83,19 @@ context 'when nothing is done during a transaction' do it 'does not raise an error' do expect do MessageDriver::Client.with_message_transaction do - #do nothing + # do nothing end end.not_to raise_error end context 'with a wait and confirm transaction' do it 'does not raise an error' do expect do MessageDriver::Client.with_message_transaction(type: :confirm_and_wait) do - #do nothing + # do nothing end end.not_to raise_error end end end