Sha256: 20413f206f464dfe9caff6b194fa730c7e5dee1f9d7aabab35e6d933f91899c3

Contents?: true

Size: 963 Bytes

Versions: 1

Compression:

Stored size: 963 Bytes

Contents

require 'test_helper'

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

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.1.10 test/lib/vedeu/api/events_test.rb