1
0
Fork 0
mirror of https://github.com/omniauth/omniauth.git synced 2022-11-09 12:31:49 -05:00

Type-cast ENV['RACK_ENV'] per master; Compartmentalize specs

This commit is contained in:
Tom Milewski 2013-09-01 14:29:57 -04:00
parent c6deafc5eb
commit 6a8292cb08
3 changed files with 5 additions and 2 deletions

View file

@ -17,7 +17,7 @@ module OmniAuth
end
def call
raise_out! if OmniAuth.config.failure_raise_out_environments.include?(ENV['RACK_ENV'])
raise_out! if OmniAuth.config.failure_raise_out_environments.include?(ENV['RACK_ENV'].to_s)
redirect_to_failure
end

View file

@ -13,7 +13,6 @@ require 'omniauth'
require 'omniauth/test'
OmniAuth.config.logger = Logger.new("/dev/null")
ENV['RACK_ENV'] ||= 'test'
RSpec.configure do |config|
config.include Rack::Test::Methods

View file

@ -5,6 +5,9 @@ describe OmniAuth::FailureEndpoint do
context "raise-out environment" do
before do
@rack_env = ENV['RACK_ENV']
ENV['RACK_ENV'] = 'test'
@default = OmniAuth.config.failure_raise_out_environments
OmniAuth.config.failure_raise_out_environments = ['test']
end
@ -20,6 +23,7 @@ describe OmniAuth::FailureEndpoint do
end
after do
ENV['RACK_ENV'] = @rack_env
OmniAuth.config.failure_raise_out_environments = @default
end
end