lib/basquiat/adapters/test_adapter.rb in basquiat-1.2.0 vs lib/basquiat/adapters/test_adapter.rb in basquiat-1.3.0.pre.1
- old
+ new
@@ -1,12 +1,9 @@
module Basquiat
module Adapters
# An adapter to be used in testing
class Test < Basquiat::Adapters::Base
- class Message < BaseMessage
- end
-
class << self
def events
@events ||= Hash.new { |hash, key| hash[key] = [] }
end
@@ -15,11 +12,11 @@
end
end
attr_reader :options
- def default_options
+ def base_options
@event_names = []
{ host: '127.0.0.1', port: 123_456, durable: true }
end
def publish(event, message, _single_message = true)
@@ -36,10 +33,10 @@
end
def listen(*)
event = subscribed_event
msg = self.class.events[event].shift
- msg ? procs[event].call(Message.new(msg)) : nil
+ msg ? procs[event].call(BaseMessage.new(msg)) : nil
end
private
def subscribed_event