Module: Waylon::RSpec::Skill
- Includes:
- Matchers::RouteMatcher
- Defined in:
- lib/waylon/rspec/skill.rb
Overview
Extras for RSpec to facilitate testing Waylon Skills
Class Method Summary collapse
-
.included(base) ⇒ Object
Sets up the RSpec environment.
Instance Method Summary collapse
-
#replies ⇒ Array<String>
An array of strings that have been sent by the bot during throughout a test.
-
#send_message(body, from: testuser, channel: nil, privately: false) ⇒ void
Sends a message to the bot.
Class Method Details
Instance Method Details
#replies ⇒ Array<String>
An array of strings that have been sent by the bot during throughout a test
46 47 48 |
# File 'lib/waylon/rspec/skill.rb', line 46 def replies TestSense. end |
#send_message(body, from: testuser, channel: nil, privately: false) ⇒ void
This method returns an undefined value.
Sends a message to the bot
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/waylon/rspec/skill.rb', line 56 def (body, from: testuser, channel: nil, privately: false) msg_details = { person_id: from.id, text: body, created_at: Time.now } if privately msg_details[:type] = :private msg_details[:receiver_id] = robot.id else msg_details[:type] = :channel msg_details[:channel_id] = channel ? channel.id : chatroom.id end TestSense.perform(msg_details) TestWorker.handle(TestSense.fake_queue) end |