Sha256: a7ad4b7abe9e40ce8676d023228c29780f1e19b1edea68837b08c26dfd90d047

Contents?: true

Size: 787 Bytes

Versions: 17

Compression:

Stored size: 787 Bytes

Contents

require 'spec_helper'

describe Alephant::Publisher::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::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::SQSHelper::Queue.new(q, a)

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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
alephant-publisher-0.6.10 spec/queue_spec.rb
alephant-publisher-0.6.9 spec/queue_spec.rb
alephant-publisher-0.6.8 spec/queue_spec.rb
alephant-publisher-0.6.7 spec/queue_spec.rb
alephant-publisher-0.6.6 spec/queue_spec.rb
alephant-publisher-0.6.5 spec/queue_spec.rb
alephant-publisher-0.6.4 spec/queue_spec.rb
alephant-publisher-0.6.3 spec/queue_spec.rb
alephant-publisher-0.6.2 spec/queue_spec.rb
alephant-publisher-0.6.1 spec/queue_spec.rb
alephant-publisher-0.5.1 spec/queue_spec.rb
alephant-publisher-0.5.0 spec/queue_spec.rb
alephant-publisher-0.4.0 spec/queue_spec.rb
alephant-publisher-0.3.1 spec/queue_spec.rb
alephant-publisher-0.3.0 spec/queue_spec.rb
alephant-publisher-0.2.9 spec/queue_spec.rb
alephant-publisher-0.2.8 spec/queue_spec.rb