Sha256: b0245a59fd38df562b1c6305f9afaf48bfb797d061f89f6cb1c4158bf9672172

Contents?: true

Size: 1022 Bytes

Versions: 2

Compression:

Stored size: 1022 Bytes

Contents

require 'spec_helper'
module Queuel
  module SQS
    describe Queue do
      let(:message) { double "Message", body: "uhuh" }
      let(:client) { double "ClientObject" }
      let(:name) { "venues queue" }
      let(:credentials) {{ access_key: "none", secret_access_key: "none" }}
      let(:queue_object_with_message) { double "QueueObject", get: message, receive_message: message }
      let(:queue_object_with_nil_message) { double "QueueObject", get: nil, receive_message: nil }

      subject do
        described_class.new client, name, credentials
      end

      before do
        message.stub_chain :as_sns_message, body: "uhuh"
        client.stub_chain :queues, named: queue_object_with_message
      end

      it_should_behave_like "a queue"

      describe "size" do
        it "should check the queue_connection's approximate_number_of_messages for size" do
          queue_object_with_message.should_receive :approximate_number_of_messages
          subject.size
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
queuel-0.4.1 spec/lib/queuel/sqs/queue_spec.rb
queuel-0.4.0 spec/lib/queuel/sqs/queue_spec.rb