mirror of
https://github.com/omniauth/omniauth.git
synced 2022-11-09 12:31:49 -05:00
Freeze omniauth in test to verify thread safety
This commit is contained in:
parent
d4c1ff0ffb
commit
e405613685
3 changed files with 5 additions and 6 deletions
1
Gemfile
1
Gemfile
|
@ -20,6 +20,7 @@ group :test do
|
|||
gem 'rack-test'
|
||||
gem 'rest-client', '~> 2.0.0', :platforms => [:jruby_18]
|
||||
gem 'rspec', '~> 3.5'
|
||||
gem 'rack-freeze'
|
||||
gem 'rubocop', '>= 0.58.2', '< 0.69.0', :platforms => %i[ruby_20 ruby_21 ruby_22 ruby_23 ruby_24]
|
||||
gem 'simplecov-lcov'
|
||||
gem 'tins', '~> 1.13', :platforms => %i[jruby_18 jruby_19 ruby_19]
|
||||
|
|
|
@ -20,6 +20,7 @@ end
|
|||
|
||||
require 'rspec'
|
||||
require 'rack/test'
|
||||
require 'rack/freeze'
|
||||
require 'omniauth'
|
||||
require 'omniauth/test'
|
||||
|
||||
|
|
|
@ -121,14 +121,11 @@ describe OmniAuth::Builder do
|
|||
|
||||
describe '#call' do
|
||||
it 'passes env to to_app.call' do
|
||||
app = lambda { |_env| [200, {}, []] }
|
||||
app = lambda { |env| [200, {}, env['CUSTOM_ENV_VALUE']] }
|
||||
builder = OmniAuth::Builder.new(app)
|
||||
env = {'REQUEST_METHOD' => 'GET', 'PATH_INFO' => '/some/path'}
|
||||
allow(app).to receive(:call).and_call_original
|
||||
env = {'REQUEST_METHOD' => 'GET', 'PATH_INFO' => '/some/path', 'CUSTOM_ENV_VALUE' => 'VALUE'}
|
||||
|
||||
builder.call(env)
|
||||
|
||||
expect(app).to have_received(:call).with(env)
|
||||
expect(builder.call(env)).to eq([200, {}, 'VALUE'])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue