Pulsar
Constants
EVENT_TYPES = [] of Pulsar::Event.class | Pulsar::TimedEvent.class
VERSION = "0.2.3"
Class methods
Will return the time taken (Time::Span) as a human readable String.
Database::QueryEvent.subscribe do |event, duration|
puts Pulsar.elaspted_text(duration) # "2.3ms"
end
This method can be used with any Time::Span.
enable_test_mode!
Enable test mode to log published events
This will enable an in memory log of events that gets cleared before each
spec is run. You can access an Event's log using the logged_events class
method
MyEvent.publish
MyEvent.logged_events.size.should eq(1)
MyEvent.logged_events.first # Returns the event that was published
test_mode_enabled?
Source