require 'spec_helper' require 'flydata-core/event/flydata_event_handler_registry' require 'event/shared_event' module FlydataCore module Event describe FlydataEventHandlerRegistry do describe "#handlers" do context "with event that has specific handlers" do it "it returns correct hanlders" do handlers = FlydataEventHandlerRegistry.handlers("test", "testing") expect(handlers.size).to eql(2) end end context "with event that has specific handlers" do it "it returns correct hanlders case-1" do handlers = FlydataEventHandlerRegistry.handlers("test2", "testing") expect(handlers.size).to eql(2) end it "it returns any hanlders for unknown verb" do handlers = FlydataEventHandlerRegistry.handlers("test2", "abcd") expect(handlers.size).to eql(1) expect(handlers.to_a()[0]).to be(AnyHandler) end end end end end end