spec/lib/aggro/message/events_spec.rb in aggro-0.0.3 vs spec/lib/aggro/message/events_spec.rb in aggro-0.0.4

- old
+ new

@@ -1,16 +1,17 @@ RSpec.describe Message::Events do EVENTS_TYPE_CODE = Message::Events::TYPE_CODE let(:id) { SecureRandom.uuid } - let(:event1) { Event.new :tested_pizza, Time.new, foo: 'bar' } - let(:event2) { Event.new :tested_system, Time.new, bar: 'foo' } + let(:event1) { Event.new :tested_pizza, Time.now.round, foo: 'bar' } + let(:event2) { Event.new :tested_system, Time.now.round, bar: 'foo' } let(:events) { [event1, event2] } let(:binary_events) do - events.map { |event| EventSerializer.serialize event }.join + events.map { |event| Marshal.dump EventSerializer.serialize event }.join end + let(:string) { EVENTS_TYPE_CODE + id + binary_events } let(:message) { Message::Events.new(id, events) } describe '.parse' do