Sha256: 1791df36d2139dd7e4f37b776db1e080b95c0fec9540df12cec5237cf9821ab2

Contents?: true

Size: 807 Bytes

Versions: 15

Compression:

Stored size: 807 Bytes

Contents

require "spec_helper"

describe Alephant::Publisher::Queue::SQSHelper::Queue do
  describe "#message" do
    it "returns a message" do
      m = double("message").as_null_object
      q = double("queue").as_null_object

      expect(q).to receive(:receive_message).and_return(m)

      instance = Alephant::Publisher::Queue::SQSHelper::Queue.new(q)

      expect(instance.message).to eq(m)
    end

    it "call see(m) on the handed archiver" do
      a = double("archiver").as_null_object
      m = double("message").as_null_object
      q = double("queue").as_null_object

      expect(q).to receive(:receive_message).and_return(m)
      expect(a).to receive(:see).with(m)

      instance = Alephant::Publisher::Queue::SQSHelper::Queue.new(q, a)

      expect(instance.message).to eq(m)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
alephant-publisher-queue-2.5.0 spec/alephant/publisher/queue/sqs_helper/queue_spec.rb
alephant-publisher-queue-2.4.2 spec/alephant/publisher/queue/sqs_helper/queue_spec.rb
alephant-publisher-queue-2.4.1 spec/alephant/publisher/queue/sqs_helper/queue_spec.rb
alephant-publisher-queue-2.4.0 spec/alephant/publisher/queue/sqs_helper/queue_spec.rb
alephant-publisher-queue-2.3.1 spec/alephant/publisher/queue/sqs_helper/queue_spec.rb
alephant-publisher-queue-2.3.0 spec/alephant/publisher/queue/sqs_helper/queue_spec.rb
alephant-publisher-queue-2.2.0 spec/queue_spec.rb
alephant-publisher-queue-2.1.4 spec/queue_spec.rb
alephant-publisher-queue-2.1.3 spec/queue_spec.rb
alephant-publisher-queue-2.1.2 spec/queue_spec.rb
alephant-publisher-queue-2.1.1 spec/queue_spec.rb
alephant-publisher-queue-2.1.0 spec/queue_spec.rb
alephant-publisher-queue-2.0.3 spec/queue_spec.rb
alephant-publisher-queue-2.0.2 spec/queue_spec.rb
alephant-publisher-queue-2.0.1 spec/queue_spec.rb