Sha256: 89aff6d17c072a8e58230dfdd8e717652cbecd45d0bc8a1da338b5283d50a2ae

Contents?: true

Size: 657 Bytes

Versions: 4

Compression:

Stored size: 657 Bytes

Contents

require 'spec_helper'

describe Freddy::MessageHandler do
  subject(:handler) { described_class.new(adapter, delivery) }

  let(:adapter) { double }
  let(:delivery) { double(metadata: metadata) }
  let(:metadata) { double(reply_to: reply_to, correlation_id: 'abc') }

  let(:reply_to) { double }

  describe '#success' do
    it 'delegates to the adapter' do
      expect(adapter).to receive(:success).with(reply_to, x: 'y')

      subject.success(x: 'y')
    end
  end

  describe '#error' do
    it 'delegates to the adapter' do
      expect(adapter).to receive(:error).with(reply_to, error: 'text')

      subject.error(error: 'text')
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
freddy-0.4.6 spec/freddy/message_handler_spec.rb
freddy-0.4.4 spec/freddy/message_handler_spec.rb
freddy-jruby-0.4.3 spec/freddy/message_handler_spec.rb
freddy-0.4.3 spec/freddy/message_handler_spec.rb