Module: Boty::RSpec::Bot
- Defined in:
- lib/boty/rspec.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/boty/rspec.rb', line 6 def self.included(base) base.instance_eval do include SlackSupport::Users before do @_bot = Boty::Bot.new("id" => "1234", "name" => "bot") end let(:bot) { Boty::DSL.new @_bot } end end |
Instance Method Details
#event(options) ⇒ Object
30 31 32 |
# File 'lib/boty/rspec.rb', line 30 def event() @_bot.event({ "type" => "message" }.merge ) end |
#message(text) ⇒ Object
34 35 36 |
# File 'lib/boty/rspec.rb', line 34 def (text) event "text" => text end |
#mock_post_message ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/boty/rspec.rb', line 19 def class << Boty::Slack.chat attr_accessor :messages def (, ) ||= [] << { message: , options: } end end end |