Sha256: 4defbc2bdfb3bce6fd87d7233b4ca94be961a60ed0d93b9400c05ae10ce0b8b2

Contents?: true

Size: 698 Bytes

Versions: 7

Compression:

Stored size: 698 Bytes

Contents

module Norikra
  module ListenerSpecHelper

    ### TODO: more util methods?
    # utilities w/ #start, #shutdown ?
    # utilities to produce dummy output events ?

    class DummyEngine
      attr_reader :events

      def initialize
        @events = {}
      end

      def send(target, events)
        @events[target] ||= []
        @events[target].push(*events)
      end
    end

    class DummyOutputPool
      attr_reader :pool

      def initialize
        @pool = {}
      end

      def push(query_name, query_group, events)
        @pool[query_group] ||= {}
        @pool[query_group][query_name] ||= []
        @pool[query_group][query_name].push(*events)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
norikra-1.5.1-java lib/norikra/listener_spec_helper.rb
norikra-1.5.0-java lib/norikra/listener_spec_helper.rb
norikra-1.4.0-java lib/norikra/listener_spec_helper.rb
norikra-1.3.1-java lib/norikra/listener_spec_helper.rb
norikra-1.3.0-java lib/norikra/listener_spec_helper.rb
norikra-1.3.0.beta.1-java lib/norikra/listener_spec_helper.rb
norikra-1.2.2-java lib/norikra/listener_spec_helper.rb