Sha256: 5150a31696d2eeb615e272af7560449e8645933172fd21c7144a53c9d2bd4392

Contents?: true

Size: 608 Bytes

Versions: 10

Compression:

Stored size: 608 Bytes

Contents

require 'spec_helper'

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

  let(:adapter) { double }
  let(:delivery) { 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

10 entries across 10 versions & 2 rubygems

Version Path
freddy-0.5.3 spec/freddy/message_handler_spec.rb
freddy-0.5.2 spec/freddy/message_handler_spec.rb
freddy-jruby-0.5.1 spec/freddy/message_handler_spec.rb
freddy-0.5.1 spec/freddy/message_handler_spec.rb
freddy-jruby-0.5.0 spec/freddy/message_handler_spec.rb
freddy-0.5.0 spec/freddy/message_handler_spec.rb
freddy-jruby-0.4.9 spec/freddy/message_handler_spec.rb
freddy-0.4.9 spec/freddy/message_handler_spec.rb
freddy-0.4.8 spec/freddy/message_handler_spec.rb
freddy-0.4.7 spec/freddy/message_handler_spec.rb