Sha256: 009ce7734aca76104ce293a5ba401d867a8b7b808233512f019267c78033231a

Contents?: true

Size: 701 Bytes

Versions: 3

Compression:

Stored size: 701 Bytes

Contents

require "minitest/autorun"
require 'clockwork/database_events/event_store'
require 'clockwork/database_events/event_collection'
require 'ostruct'

describe Clockwork::DatabaseEvents::EventStore do

  described_class = Clockwork::DatabaseEvents::EventStore
  EventCollection = Clockwork::DatabaseEvents::EventCollection

  describe '#register' do
    it 'adds the event to the event group' do
      event_group = EventCollection.new
      EventCollection.stubs(:new).returns(event_group)

      event = OpenStruct.new
      model = OpenStruct.new id: 1
      subject = described_class.new(Proc.new {})

      event_group.expects(:add).with(event)

      subject.register(event, model)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
clockwork-3.0.2 test/database_events/event_store_test.rb
clockwork-3.0.1 test/database_events/event_store_test.rb
clockwork-3.0.0 test/database_events/event_store_test.rb