Sha256: e562b3011126819fc42ae55444eff96823fe0c1196e679c521f1b66ef13331c3

Contents?: true

Size: 990 Bytes

Versions: 2

Compression:

Stored size: 990 Bytes

Contents

require 'test_helper'
require 'vedeu/api/events'

module Vedeu
  module API
    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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.1.9 test/lib/vedeu/api/events_test.rb
vedeu-0.1.8 test/lib/vedeu/api/events_test.rb