Sha256: 223d5b2f0a1a14517f6c7ac9809b68b5a4dfeb58706f7f1cf40064b282fdbdbc

Contents?: true

Size: 730 Bytes

Versions: 3

Compression:

Stored size: 730 Bytes

Contents

RSpec.describe Message::CreateAggregate do
  let(:sender) { SecureRandom.uuid }
  let(:id) { SecureRandom.uuid }
  let(:type) { 'Test' }

  let(:string) { Message::CreateAggregate::TYPE_CODE + sender + id + type }

  let(:message) { Message::CreateAggregate.new(sender, id, type) }

  describe '.parse' do
    it 'should parse correctly' do
      message = Message::CreateAggregate.parse string

      expect(message).to be_a Message::CreateAggregate
      expect(message.sender).to eq sender
      expect(message.id).to eq id
      expect(message.type).to eq type
    end
  end

  describe '#to_s' do
    it 'should serialize correctly' do
      serialized = message.to_s

      expect(serialized).to eq string
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aggro-0.0.4 spec/lib/aggro/message/create_aggregate_spec.rb
aggro-0.0.3 spec/lib/aggro/message/create_aggregate_spec.rb
aggro-0.0.2 spec/lib/aggro/message/create_aggregate_spec.rb