Sha256: 8caca116328b8750210ed938f2b55739a4e47724fa6c31f52bc367a09d611d31

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

Feature: Error Handling

  Background:
    Given I am connected to the broker

  @bunny
  Scenario: Queue isn't found on the broker
    When I execute the following code:
    """ruby
    MessageDriver::Broker.dynamic_destination("missing_queue", passive: true)
    """

    Then I expect it to raise a MessageDriver::QueueNotFound error

  @no_travis
  @bunny
  Scenario: The broker goes down
    Given the following broker configuration:
    """ruby
    MessageDriver::Broker.define do |b|
      b.destination :my_queue, "broker_down_queue", arguments: {:'x-expires' => 10000 }
    end
    """

    When I execute the following code:
    """ruby
    publish(:my_queue, "Test Message 1")
    """
    And the broker goes down
    And I execute the following code:
    """ruby
    publish(:my_queue, "Test Message 2")
    """
    Then I expect it to raise a MessageDriver::ConnectionException error

    When the broker comes up
    And I execute the following code:
    """ruby
    publish(:my_queue, "Test Message 3")
    """

    Then I expect to have no errors
    And I expect to find 2 messages on :my_queue with:
      | body           |
      | Test Message 1 |
      | Test Message 3 |

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
message-driver-0.1.0 features/error_handling.feature