lib/basquiat/adapters/test_adapter.rb in basquiat-1.1.1 vs lib/basquiat/adapters/test_adapter.rb in basquiat-1.2.0
- old
+ new
@@ -1,10 +1,11 @@
module Basquiat
module Adapters
# An adapter to be used in testing
- class Test
- include Basquiat::Adapters::Base
+ class Test < Basquiat::Adapters::Base
+ class Message < BaseMessage
+ end
class << self
def events
@events ||= Hash.new { |hash, key| hash[key] = [] }
end
@@ -35,10 +36,10 @@
end
def listen(*)
event = subscribed_event
msg = self.class.events[event].shift
- msg ? procs[event].call(Basquiat::Json.decode(msg)) : nil
+ msg ? procs[event].call(Message.new(msg)) : nil
end
private
def subscribed_event