features/publishing_with_transactions.feature in message-driver-0.1.0 vs features/publishing_with_transactions.feature in message-driver-0.2.0.rc1

- old
+ new

@@ -1,36 +1,32 @@ @bunny Feature: Publishing a Message within a Transaction Background: - Given the following broker configuration: - """ruby - MessageDriver::Broker.define do |b| - b.destination :my_queue, "my_queue", exclusive: true - end - """ + Given I am connected to the broker + And I have a destination :publish_transaction with no messages on it Scenario: The block completes successfully - When I execute the following code: + When I execute the following code """ruby with_message_transaction do - publish(:my_queue, "Transacted Message 1") - publish(:my_queue, "Transacted Message 2") + publish(:publish_transaction, "Transacted Message 1") + publish(:publish_transaction, "Transacted Message 2") end """ - Then I expect to find 2 messages on :my_queue with: + Then I expect to find the following 2 messages on :publish_transaction | body | | Transacted Message 1 | | Transacted Message 2 | Scenario: An error is raised inside the block - When I execute the following code: + When I execute the following code """ruby with_message_transaction do - publish(:my_queue, "Transacted Message 1") + publish(:publish_transaction, "Transacted Message 1") raise "an error that causes a rollback" - publish(:my_queue, "Transacted Message 2") + publish(:publish_transaction, "Transacted Message 2") end """ Then I expect it to raise "an error that causes a rollback" - And I expect to find no messages on :my_queue + And I expect to find no messages on :publish_transaction