Sha256: fa9abd7f8330124f0b62ee182600526284d04620dd91c8a6a4eb8bfcbc57b4a3

Contents?: true

Size: 1.42 KB

Versions: 48

Compression:

Stored size: 1.42 KB

Contents

require 'spec_helper'
require 'flydata-core/event/flydata_event_processor'
require 'flydata-core/event/flydata_event'
require 'event/shared_event'

module FlydataCore
  module Event
    describe  FlydataEventProcessor do
      describe "#process" do

        context "when event has one verb handler and one any verb handler," do
          let(:event) {FlydataEvent.new("test2", "testing", id: 1)}
          it "should call both handlers" do
            expect(AnyHandler).to receive(:handle).with(event)
            expect(Handler3).to receive(:handle).with(event)
            FlydataEventProcessor.process(event)
          end
        end

        context "when event has two handlers," do
          let(:event) {FlydataEvent.new("test","testing", id: 1)}
          it "should call both handlers" do
            expect(Handler1).to receive(:handle).with(event)
            expect(Handler2).to receive(:handle).with(event)
            FlydataEventProcessor.process(event)
          end
        end

        context "when a event has no handlers," do
          let(:event) {FlydataEvent.new("test5","testing")}
          it "no handler should be called" do
            expect(Handler1).not_to receive(:handle).with(event)
            expect(Handler2).not_to receive(:handle).with(event)
            expect(Handler3).not_to receive(:handle).with(event)
            FlydataEventProcessor.process(event)
          end
        end

      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
flydata-0.8.10.2 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.10.1 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.9.11 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.10 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.9 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.8 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.7 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.6 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.5 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.4 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.3 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.2 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.1 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.8.0 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.7.19 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.7.18 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.7.17 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.7.16 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.7.15 flydata-core/spec/event/flydata_event_processor_spec.rb
flydata-0.7.14 flydata-core/spec/event/flydata_event_processor_spec.rb