spec/units/message_driver/client_spec.rb in message-driver-0.6.1 vs spec/units/message_driver/client_spec.rb in message-driver-0.7.0
- old
+ new
@@ -172,11 +172,11 @@
context 'when the block raises an error' do
it 'calls rollback instead of commit and raises the error' do
expect do
subject.with_message_transaction do
- fail 'having a tough time'
+ raise 'having a tough time'
end
end.to raise_error 'having a tough time'
expect(adapter_context).to have_received(:begin_transaction)
expect(adapter_context).not_to have_received(:commit_transaction)
expect(adapter_context).to have_received(:rollback_transaction)
@@ -186,11 +186,11 @@
it 'logs the error from the rollback and raises the original error' do
allow(logger).to receive(:error)
allow(adapter_context).to receive(:rollback_transaction).and_raise('rollback failed!')
expect do
subject.with_message_transaction do
- fail 'having a tough time'
+ raise 'having a tough time'
end
end.to raise_error 'having a tough time'
expect(logger).to have_received(:error).with(match('rollback failed!'))
end
end
@@ -210,10 +210,10 @@
context 'when the block raises an error' do
it 'calls rollback instead of commit and raises the error' do
expect do
subject.with_message_transaction do
subject.with_message_transaction do
- fail 'having a tough time'
+ raise 'having a tough time'
end
end
end.to raise_error 'having a tough time'
expect(adapter_context).to have_received(:begin_transaction).once
expect(adapter_context).not_to have_received(:commit_transaction)