Sha256: ca2da110e0cf39963d7c0a554e7e5cb442042d77d8855b2a67897ab77169782a
Contents?: true
Size: 592 Bytes
Versions: 1
Compression:
Stored size: 592 Bytes
Contents
require 'rspec/expectations' RSpec::Matchers.define :respond_with_slack_message do |expected| match do |actual| channel, user, message = parse(actual) SlackRubyBot.config.user ||= 'rubybot' allow(Giphy).to receive(:random) expect(SlackRubyBot::Commands::Base).to receive(:send_message).with(channel, expected) app.send(:message, text: message, channel: channel, user: user) true end private def parse(actual) actual = { message: actual } unless actual.is_a?(Hash) [actual[:channel] || 'channel', actual[:user] || 'user', actual[:message]] end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
slack-ruby-bot-0.1.0 | lib/slack-ruby-bot/rspec/support/slack-ruby-bot/respond_with_slack_message.rb |