-
-
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.
Added SlackRubyBot::Config.send_gifs, set via code or ENV['SLACK_RUBY…
…_BOT_SEND_GIFS']. Closes dblock/slack-gamebot#40.
- Loading branch information
Showing
7 changed files
with
124 additions
and
4 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
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,55 @@ | ||
require 'spec_helper' | ||
|
||
describe SlackRubyBot::Config do | ||
context 'send_gifs?' do | ||
context 'default' do | ||
it 'is true' do | ||
expect(SlackRubyBot::Config.send_gifs?).to be true | ||
end | ||
end | ||
context 'set to false' do | ||
before do | ||
SlackRubyBot::Config.send_gifs = false | ||
end | ||
it 'is false' do | ||
expect(SlackRubyBot::Config.send_gifs?).to be false | ||
end | ||
after do | ||
SlackRubyBot::Config.send_gifs = nil | ||
end | ||
end | ||
context 'set to false via SLACK_RUBY_BOT_SEND_GIFS' do | ||
before do | ||
ENV['SLACK_RUBY_BOT_SEND_GIFS'] = 'false' | ||
end | ||
it 'is false' do | ||
expect(SlackRubyBot::Config.send_gifs?).to be false | ||
end | ||
after do | ||
ENV.delete 'SLACK_RUBY_BOT_SEND_GIFS' | ||
end | ||
end | ||
context 'set to true' do | ||
before do | ||
SlackRubyBot::Config.send_gifs = true | ||
end | ||
it 'is false' do | ||
expect(SlackRubyBot::Config.send_gifs?).to be true | ||
end | ||
after do | ||
SlackRubyBot::Config.send_gifs = nil | ||
end | ||
end | ||
context 'set to true via SLACK_RUBY_BOT_SEND_GIFS' do | ||
before do | ||
ENV['SLACK_RUBY_BOT_SEND_GIFS'] = 'true' | ||
end | ||
it 'is false' do | ||
expect(SlackRubyBot::Config.send_gifs?).to be true | ||
end | ||
after do | ||
ENV.delete 'SLACK_RUBY_BOT_SEND_GIFS' | ||
end | ||
end | ||
end | ||
end |