Class: Lita::Adapters::Test

Inherits:
Lita::Adapter show all
Defined in:
lib/lita/adapters/test.rb

Overview

An adapter for testing Lita and Lita plugins.

Since:

  • 4.6.0

Defined Under Namespace

Classes: ChatService

Constant Summary

Constants inherited from Lita::Adapter

Lita::Adapter::REQUIRED_METHODS

Instance Attribute Summary

Attributes inherited from Lita::Adapter

#robot

Attributes included from Configurable

#configuration_builder

Instance Method Summary collapse

Methods inherited from Lita::Adapter

#config, #join, #log, #mention_format, #part, require_config, #roster, #run, #set_topic, #shut_down, t, translate, #translate

Methods included from Namespace

#namespace

Methods included from Configurable

#config, #inherited

Constructor Details

#initialize(robot) ⇒ Test

Returns a new instance of Test.

Since:

  • 4.6.0



19
20
21
22
23
# File 'lib/lita/adapters/test.rb', line 19

def initialize(robot)
  super

  self.sent_messages = []
end

Instance Method Details

#chat_serviceObject

Adapter-specific methods available via Robot#chat_service.

Since:

  • 4.6.0



26
27
28
# File 'lib/lita/adapters/test.rb', line 26

def chat_service
  ChatService.new(sent_messages)
end

#send_messages(_target, strings) ⇒ Object

Records outgoing messages.

Since:

  • 4.6.0



31
32
33
# File 'lib/lita/adapters/test.rb', line 31

def send_messages(_target, strings)
  sent_messages.concat(strings)
end