Sha256: 15e9ca1de4bfcc5f43c80126b0ced659808c9d2d8e83075f111df6071311b664
Contents?: true
Size: 731 Bytes
Versions: 2
Compression:
Stored size: 731 Bytes
Contents
require 'spec_helper' describe SlackRubyBot::Bot do let! :command do Class.new(SlackRubyBot::Bot) do command 'bot_spec' do |client, data, match| client.say(channel: data.channel, text: match['expression']) end end end def app SlackRubyBot::Bot.instance end let(:client) { app.send(:client) } it 'sends a message' do expect(client).to receive(:message).with(channel: 'channel', text: 'message') app.send(:message, client, Hashie::Mash.new(text: "#{SlackRubyBot.config.user} bot_spec message", channel: 'channel', user: 'user')) end it 'sends a message' do expect(message: "#{SlackRubyBot.config.user} bot_spec message").to respond_with_slack_message('message') end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
slack-ruby-bot-0.7.0 | spec/slack-ruby-bot/commands/bot_spec.rb |
slack-ruby-bot-0.6.2 | spec/slack-ruby-bot/commands/bot_spec.rb |