-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #23 that forced the bot name into the expression being evaluated.
- Loading branch information
Showing
4 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'spec_helper' | ||
|
||
describe SlackRubyBot::Commands do | ||
let! :command do | ||
Class.new(SlackRubyBot::Commands::Base) do | ||
match(/^Reticulate (?<spline_name>\w*)$/) do |client, data, match| | ||
send_message client, data.channel, "Reticulated #{match[:spline_name]}." | ||
end | ||
end | ||
end | ||
def app | ||
SlackRubyBot::App.new | ||
end | ||
it 'matches' do | ||
expect(message: 'Reticulate spline').to respond_with_slack_message('Reticulated spline.') | ||
end | ||
end |