Skip to content

Commit

Permalink
Fix #43: Issuing a bot command terminates bot.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Jan 29, 2016
1 parent b4ee9de commit 5e9d379
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 0.6.1 (Next)

* [#43](https://github.com/dblock/slack-ruby-bot/issues/43): Issuing a `bot` command terminates bot - [@dblock](https://github.com/dblock).
* [#40](https://github.com/dblock/slack-ruby-bot/pull/40): Added `SlackRubyBot::Config.reset!` - [@accessd](https://github.com/accessd).
* Your contribution here.

Expand Down
4 changes: 4 additions & 0 deletions lib/slack-ruby-bot/bot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ def self.run
def self.instance
SlackRubyBot::App.instance
end

def self.call(client, data, _match)
client.say(channel: data.channel, text: "Sorry <@#{data.user}>, I don't understand that command!", gif: 'idiot')
end
end
end
10 changes: 10 additions & 0 deletions spec/slack-ruby-bot/commands/bot_message_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'spec_helper'

describe SlackRubyBot::Commands::Help do
def app
SlackRubyBot::App.new
end
it 'bot' do
expect(message: "#{SlackRubyBot.config.user} bot").to respond_with_slack_message("Sorry <@user>, I don't understand that command!")
end
end

0 comments on commit 5e9d379

Please sign in to comment.