Sha256: 7c290381afcad3de5a11aca9bfb2e2827121ff40a05e2236c8f9d36c82e16b2f

Contents?: true

Size: 577 Bytes

Versions: 11

Compression:

Stored size: 577 Bytes

Contents

require 'spec_helper'

describe Freddy::Consumer do
  let(:freddy) { Freddy.build(logger, config) }

  let(:destination) { random_destination }
  let(:payload)     { {pay: 'load'} }

  let(:consumer) { freddy.consumer }

  it 'raises exception when no consumer is provided' do
    expect { consumer.consume destination }.to raise_error described_class::EmptyConsumer
  end

  it "doesn't call passed block without any messages" do
    consumer.consume destination do
      @message_received = true
    end
    default_sleep

    expect(@message_received).to be_falsy
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
freddy-0.4.2 spec/freddy/consumer_spec.rb
freddy-0.4.1 spec/freddy/consumer_spec.rb
freddy-0.4.0 spec/freddy/consumer_spec.rb
freddy-0.3.7 spec/freddy/consumer_spec.rb
freddy-0.3.6 spec/freddy/consumer_spec.rb
freddy-0.3.5 spec/freddy/consumer_spec.rb
freddy-0.3.4 spec/freddy/consumer_spec.rb
freddy-0.3.3 spec/freddy/consumer_spec.rb
freddy-0.3.2 spec/freddy/consumer_spec.rb
freddy-0.3.1 spec/freddy/consumer_spec.rb
freddy-0.3.0 spec/freddy/consumer_spec.rb