Sha256: 36f1ec3bd6860c3f67da8e1271819efb53aa78637190caa5e645fc3dec276892

Contents?: true

Size: 1.71 KB

Versions: 4

Compression:

Stored size: 1.71 KB

Contents

require 'spec_helper'
require 'integration/coolio/spec_helper'
require 'integration/eventmachine/spec_helper'

describe "AMQ::Client::Coolio", :nojruby => true do
  include EventedSpec::SpecHelper
  default_timeout 1

  let(:message) { "Message with xCE \xCE" }

  it "should receive the message with xCE byte in it without errors" do
    coolio_amqp_connect do |client|
      channel = AMQ::Client::Channel.new(client, 1)
      channel.open do end
      queue = AMQ::Client::Queue.new(client, channel)
      queue.declare(false, false, false, true)
      queue.bind("amq.fanout")
      queue.consume(true) do |_, consumer_tag|
        queue.on_delivery do |method, header, payload|
          @received_message = payload
          done
        end

        exchange = AMQ::Client::Exchange.new(client, channel, "amq.fanout", :fanout)
        exchange.publish(message)
      end
    end

    @received_message.should == message
  end
end

describe AMQ::Client::EventMachineClient do
  include EventedSpec::SpecHelper
  default_timeout 1

  let(:message) { "Message with xCE \xCE" }

  it "should receive the message with xCE byte in it without errors" do
    em_amqp_connect do |client|
      channel = AMQ::Client::Channel.new(client, 1)
      channel.open do end
      queue = AMQ::Client::Queue.new(client, channel)
      queue.declare(false, false, false, true)
      queue.bind("amq.fanout")
      queue.consume(true) do |_, consumer_tag|
        queue.on_delivery do |method, header, payload|
          @received_message = payload
          done
        end

        exchange = AMQ::Client::Exchange.new(client, channel, "amq.fanout", :fanout)
        exchange.publish(message)
      end
    end

    @received_message.should == message
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
amq-client-0.7.0.alpha3 spec/regression/bad_frame_slicing_in_adapters_spec.rb
amq-client-0.7.0.alpha2 spec/regression/bad_frame_slicing_in_adapters_spec.rb
amq-client-0.7.0.alpha1 spec/regression/bad_frame_slicing_in_adapters_spec.rb
amq-client-0.5.0 spec/regression/bad_frame_slicing_in_adapters_spec.rb