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.

20 lines
629 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 'space' do |client, data, match|
  6. send_message client, data.channel, "#{match[:command]}: #{match[:expression]}"
  7. end
  8. end
  9. end
  10. def app
  11. SlackRubyBot::App.new
  12. end
  13. it 'matches leading spaces' do
  14. expect(message: " #{SlackRubyBot.config.user} space red").to respond_with_slack_message('space: red')
  15. end
  16. it 'matches trailing spaces' do
  17. expect(message: "#{SlackRubyBot.config.user} space red ").to respond_with_slack_message('space: red')
  18. end
  19. end