Sha256: 5bac5924321f0e584c4ee3c12d447ae8ba009bbea68dfaeab33a8caf0020ccb2

Contents?: true

Size: 453 Bytes

Versions: 3

Compression:

Stored size: 453 Bytes

Contents

RSpec.describe EventBus do
  subject(:event_bus) { EventBus.new }

  let(:fake_server) { spy }

  let(:topic) { SecureRandom.uuid }
  let(:event) { :event! }

  before do
    allow(Aggro).to receive(:server).and_return fake_server
  end

  describe '#publish' do
    it 'should publish an event via the given publisher' do
      event_bus.publish topic, event

      expect(fake_server).to have_received(:publish).with Message::Events
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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