Sha256: 20f41a94db40f14632c4d0f3d7a3b609419593410a86f77ea23298c88e967d45

Contents?: true

Size: 685 Bytes

Versions: 6

Compression:

Stored size: 685 Bytes

Contents

require "spec_helper"

describe "Queue consumer" do
  let(:connection) { HotBunnies.connect }
  let(:channel)    { connection.create_channel }

  after :each do
    channel.close
    connection.close
  end

  it "provides predicates" do
    queue        = channel.queue("", :auto_delete => true)

    subscription = queue.subscribe(:blocking => false) { |_, _| nil }

    # consumer tag will be sent by the broker, so this happens
    # asynchronously and we can either add callbacks/use latches or
    # just wait. MK.
    sleep(1.0)
    subscription.should be_active

    subscription.cancel
    sleep(1.0)
    subscription.should_not be_active

    subscription.shutdown!
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hot_bunnies-1.3.8-java spec/integration/basic_consume_spec.rb
hot_bunnies-1.3.7-java spec/integration/basic_consume_spec.rb
hot_bunnies-1.3.6-java spec/integration/basic_consume_spec.rb
hot_bunnies-1.3.5-java spec/integration/basic_consume_spec.rb
hot_bunnies-1.3.4-java spec/integration/basic_consume_spec.rb
hot_bunnies-1.3.3-java spec/integration/basic_consume_spec.rb