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

9 years ago
  1. require 'spec_helper'
  2. describe SlackRubyBot::Commands do
  3. let! :command do
  4. Class.new(SlackRubyBot::Commands::Base) do
  5. operator '=' do |client, data, match|
  6. send_message client, data.channel, "#{match[:operator]}: #{match[:expression]}"
  7. end
  8. operator '+', '-' do |client, data, match|
  9. send_message client, data.channel, "#{match[:operator]}: #{match[:expression]}"
  10. end
  11. end
  12. end
  13. def app
  14. SlackRubyBot::App.new
  15. end
  16. it 'supports operator blocks' do
  17. expect(message: '=2+2').to respond_with_slack_message('=: 2+2')
  18. expect(message: '+2+2').to respond_with_slack_message('+: 2+2')
  19. expect(message: '-2+2').to respond_with_slack_message('-: 2+2')
  20. end
  21. end