Sha256: 321cf45b01f40ccf1477215867c62553bfe426dd8d78d830fefc1e083cb00ec9

Contents?: true

Size: 1.15 KB

Versions: 53

Compression:

Stored size: 1.15 KB

Contents

# encoding: utf-8
require 'spec_helper'


describe "When exchange a message is published to has no bindings" do

  #
  # Environment
  #

  include EventedSpec::AMQPSpec
  default_timeout 1.5

  amqp_before do
    @producer_channel    = AMQP::Channel.new
    @consumer_channel    = AMQP::Channel.new
  end

  # ...


  #
  # Examples
  #

  context "and message is published as :mandatory" do
    it "that message is returned to the publisher" do
      exchange = @producer_channel.fanout("amqpgem.examples.mandatory.messages", :auto_delete => true)

      exchange.on_return do |basic_return, metadata, payload|
        done if payload == "mandatory message body"
      end

      exchange.publish "mandatory message body", :mandatory => true
    end
  end



  context "and message is published as non :mandatory" do
    it "that message is dropped" do
      exchange = @producer_channel.fanout("amqpgem.examples.mandatory.messages", :auto_delete => true)

      exchange.on_return do |basic_return, metadata, payload|
        fail "Should not happen"
      end
      exchange.publish "mandatory message body", :mandatory => false

      done(1.0)
    end
  end
end # describe

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
amqp-1.8.0 spec/integration/mandatory_messages_spec.rb
amqp-1.7.0 spec/integration/mandatory_messages_spec.rb
amqp-1.6.0 spec/integration/mandatory_messages_spec.rb
amqp-1.5.3 spec/integration/mandatory_messages_spec.rb
amqp-1.5.2 spec/integration/mandatory_messages_spec.rb
amqp-1.5.1 spec/integration/mandatory_messages_spec.rb
amqp-1.5.0 spec/integration/mandatory_messages_spec.rb
amqp-1.4.2 spec/integration/mandatory_messages_spec.rb
amqp-1.4.1 spec/integration/mandatory_messages_spec.rb
amqp-1.4.0 spec/integration/mandatory_messages_spec.rb
amqp-1.3.0 spec/integration/mandatory_messages_spec.rb
amqp-1.2.1 spec/integration/mandatory_messages_spec.rb
amqp-1.2.0 spec/integration/mandatory_messages_spec.rb
amqp-1.1.8 spec/integration/mandatory_messages_spec.rb
amqp-1.1.7 spec/integration/mandatory_messages_spec.rb
amqp-1.1.6 spec/integration/mandatory_messages_spec.rb
amqp-1.1.5 spec/integration/mandatory_messages_spec.rb
amqp-1.1.4 spec/integration/mandatory_messages_spec.rb
amqp-1.1.3 spec/integration/mandatory_messages_spec.rb
amqp-1.0.4 spec/integration/mandatory_messages_spec.rb