Sha256: c8da2d815ee74423c0039463d1e4b9e15ed11791ea358c23d44412f1c73fe7dd

Contents?: true

Size: 729 Bytes

Versions: 3

Compression:

Stored size: 729 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'
require 'basquiat/adapters/rabbitmq_adapter'

describe Basquiat::Adapters::RabbitMq::Message do
  let(:json) do
    { key: 'value', date: Date.new.iso8601 }.to_json
  end
  subject(:message) { Basquiat::Adapters::RabbitMq::Message.new(json) }

  it 'delegates all calls to message hash' do
    expect(message[:key]).to eq('value')
  end

  it 'can be JSONified' do
    expect(MultiJson.dump(message)).to eq(json)
  end

  it 'exposes the delivery information' do
    expect { message.di }.to_not raise_error
    expect { message.delivery_info }.to_not raise_error
  end

  it 'exposes the properties of the message' do
    expect { message.props }.to_not raise_error
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
basquiat-1.3.2 spec/lib/adapters/rabbitmq/message_spec.rb
basquiat-1.3.1 spec/lib/adapters/rabbitmq/message_spec.rb
basquiat-1.3.0 spec/lib/adapters/rabbitmq/message_spec.rb