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.

21 lines
647 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. command 'sayhi'
  6. command 'saybye'
  7. def self.call(client, data, match)
  8. send_message client, data.channel, "#{match[:command]}: #{match[:expression]}"
  9. end
  10. end
  11. end
  12. def app
  13. SlackRubyBot::App.new
  14. end
  15. it 'supports multiple commands' do
  16. expect(message: "#{SlackRubyBot.config.user} sayhi arg1 arg2").to respond_with_slack_message('sayhi: arg1 arg2')
  17. expect(message: "#{SlackRubyBot.config.user} saybye arg1 arg2").to respond_with_slack_message('saybye: arg1 arg2')
  18. end
  19. end