Sha256: a56380e21d7e607e648f723af1a0eef58143adfd93ed848d5bd2969fe3bdc757
Contents?: true
Size: 975 Bytes
Versions: 4
Compression:
Stored size: 975 Bytes
Contents
require 'test_helper' module Vedeu module API describe Events do describe '#event' do it 'adds the event block to the handlers' do skip events = Events.new events.event(:some_event) { proc { |x| x } } end it 'adds the specified throttle to the throttles' do skip events = Events.new events.event(:some_event, 250) { proc { |x| x } } end end describe '#trigger' do it 'returns a collection containing the event when the event is ' \ 'pre-registered' do events = Events.new do event(:_exit_) { fail StopIteration } end proc { events.trigger(:_exit_) }.must_raise(StopIteration) end it 'returns an empty collection when the event has not been registered' do events = Events.new events.trigger(:_not_found_).must_be_empty end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems