Sha256: 2b7649a325e92f1bae6adeb7867de9d03c134c598432c35ba6e9aab75a65dbe3

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

require "barnyard_harvester"

SQS_SETTINGS = {
    :sqs_endpoint => "sqs.us-west-1.amazonaws.com",
    :access_key_id => ENV["AWS_ACCESS_KEY_ID"],
    :secret_access_key => ENV["AWS_SECRET_ACCESS_KEY"]
}

QUEUE_NAME = "test001"

describe "Test SQS" do

  before(:each) do

    @q = BarnyardHarvester::GenericQueue.new(queueing: :sqs, sqs_settings: SQS_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_sqs_spec.rb
barnyard_harvester-0.0.12 spec/queue_sqs_spec.rb