1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
require 'ostruct'
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
|