Sha256: e46c5474241ffcec05215c79830e5193e225b26d12de89cccd648c06c11c7531

Contents?: true

Size: 600 Bytes

Versions: 1

Compression:

Stored size: 600 Bytes

Contents

require 'spec_helper'

describe Basquiat::Adapters::BaseMessage do
  subject(:message) { Basquiat::Adapters::BaseMessage.new({ data: 'everything is AWESOME!' }.to_json) }

  it 'delegates calls to the JSON' do
    expect(message.fetch(:data)).to eq('everything is AWESOME!')
    expect { message.fetch(:error) }.to raise_error KeyError
  end

  [:ack?, :unack, :requeue, :delay_redelivery].each do |meth|
    it "raise a SubclassResponsibility error if #{meth} isn't implemented" do
      expect { message.public_send(meth) }.to raise_error Basquiat::Errors::SubclassResponsibility
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
basquiat-1.2.0 spec/lib/adapters/base_message_spec.rb