A Slack Bot that pulls Pixiv information and posts the full image(s) into Slack, with iOS shortcuts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

23 lines
719 B

require 'spec_helper'
describe SlackRubyBot::Commands do
let! :command do
Class.new(SlackRubyBot::Commands::Base) do
operator '=' do |client, data, match|
send_message client, data.channel, "#{match[:operator]}: #{match[:expression]}"
end
operator '+', '-' do |client, data, match|
send_message client, data.channel, "#{match[:operator]}: #{match[:expression]}"
end
end
end
def app
SlackRubyBot::App.new
end
it 'supports operator blocks' do
expect(message: '=2+2').to respond_with_slack_message('=: 2+2')
expect(message: '+2+2').to respond_with_slack_message('+: 2+2')
expect(message: '-2+2').to respond_with_slack_message('-: 2+2')
end
end