Sha256: 2d320eada2d8df15763f7474c486a3ebe27d67b7636870c8cc74da35491d3e2d

Contents?: true

Size: 699 Bytes

Versions: 2

Compression:

Stored size: 699 Bytes

Contents

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

2 entries across 2 versions & 1 rubygems

Version Path
basquiat-1.3.0.pre.1 spec/lib/adapters/rabbitmq/message_spec.rb
basquiat-1.2.0 spec/lib/adapters/rabbitmq/message_spec.rb