Sha256: 9db7c7626ee8e2afe81e15bcdafc385e814b5fe1426ec8a402055c8a2f78f183

Contents?: true

Size: 542 Bytes

Versions: 2

Compression:

Stored size: 542 Bytes

Contents

require "barnyard_harvester"

RABBITMQ_SETTINGS = {
    :host => "localhost"
    #    :port => 6163
}

QUEUE_NAME = "test001"

describe "Test RabbitMQ" do

  before(:each) do

    @q = BarnyardHarvester::GenericQueue.new(queueing: :rabbitmq, rabbitmq_settings: RABBITMQ_SETTINGS)

  end

  it "Push 10 items on the queue" do

    @q.empty(QUEUE_NAME)

    10.times do |i|
      @q.push(QUEUE_NAME, "My Message #{i}")
    end

  end

  it "Pop 10 items" do

    10.times do |i|
      msg = @q.pop(QUEUE_NAME)
      puts msg
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
barnyard_harvester-0.0.13 spec/queue_rabbitmq_spec.rb
barnyard_harvester-0.0.12 spec/queue_rabbitmq_spec.rb