Sha256: 5677df77db2ae9eee6d5cfba92a59246f171ebd595ab24d7dbc197e927562547

Contents?: true

Size: 558 Bytes

Versions: 3

Compression:

Stored size: 558 Bytes

Contents

RSpec.describe Message::Heartbeat do
  let(:message_type) { Message::Heartbeat::TYPE_CODE }
  let(:sender) { SecureRandom.uuid }

  let(:string) { message_type + sender }

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

      expect(message).to be_a Message::Heartbeat
      expect(message.sender).to eq sender
    end
  end

  describe '#to_s' do
    it 'should serialize correctly' do
      serialized = Message::Heartbeat.new(sender).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/heartbeat_spec.rb
aggro-0.0.3 spec/lib/aggro/message/heartbeat_spec.rb
aggro-0.0.2 spec/lib/aggro/message/heartbeat_spec.rb