Sha256: 5dff3e7fe8d96204c8e892f021223a991a0e52ee9717f3271760871785faa823

Contents?: true

Size: 921 Bytes

Versions: 6

Compression:

Stored size: 921 Bytes

Contents

require 'test_helper'
require 'vedeu/support/events'

module Vedeu
  describe Events do
    describe '#on' do
      it 'adds the event block to the handlers' do
        skip
        events = Events.new
        events.on(:some_event) { proc { |x| x } }
      end

      it 'adds the specified throttle to the throttles' do
        skip
        events = Events.new
        events.on(: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
          on(:_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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.1.7 test/lib/vedeu/support/events_test.rb
vedeu-0.1.6 test/lib/vedeu/support/events_test.rb
vedeu-0.1.5 test/lib/vedeu/support/events_test.rb
vedeu-0.1.4 test/lib/vedeu/support/events_test.rb
vedeu-0.1.3 test/lib/vedeu/support/events_test.rb
vedeu-0.1.2 test/lib/vedeu/support/events_test.rb