Sha256: fa28f9c77bd381b134d22c3bbfe9299a20dd08f31e206e9ccd08bba6e4619bd7

Contents?: true

Size: 1.34 KB

Versions: 8

Compression:

Stored size: 1.34 KB

Contents

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

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
slack-ruby-bot-bhe-0.5.5.3 spec/slack-ruby-bot/config_spec.rb
slack-ruby-bot-0.6.0 spec/slack-ruby-bot/config_spec.rb
slack-ruby-bot-0.5.5 spec/slack-ruby-bot/config_spec.rb
slack-ruby-bot-0.5.4 spec/slack-ruby-bot/config_spec.rb
slack-ruby-bot-0.5.3 spec/slack-ruby-bot/config_spec.rb
slack-ruby-bot-0.5.2 spec/slack-ruby-bot/config_spec.rb
slack-ruby-bot-0.5.1 spec/slack-ruby-bot/config_spec.rb
slack-ruby-bot-0.5.0 spec/slack-ruby-bot/config_spec.rb