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

added OmniAuth::Test package with PhonySession for test support

This commit is contained in:
James A. Rosen 2010-06-18 20:54:46 -04:00
parent 7691e0c295
commit 9402f6eb5e
3 changed files with 19 additions and 0 deletions

View file

@ -6,6 +6,7 @@ module OmniAuth
autoload :Builder, 'omniauth/builder'
autoload :Strategy, 'omniauth/strategy'
autoload :Test, 'omniauth/test'
module Strategies
autoload :Password, 'omniauth/strategies/password'

View file

@ -0,0 +1,10 @@
module OmniAuth
# Support for testing OmniAuth strategies.
module Test
autoload :PhonySession, 'omniauth/test/phony_session'
end
end

View file

@ -0,0 +1,8 @@
class OmniAuth::Test::PhonySession
def initialize(app); @app = app end
def call(env)
@session ||= (env['rack.session'] || {})
env['rack.session'] = @session
@app.call(env)
end
end