Module: Warden::Test::Mock

Defined in:
lib/warden/test/mock.rb

Overview

A mock of an application to get a Warden object to test on Note: During the teardown phase of your specs you should include: Warden.test_reset!

Defined Under Namespace

Classes: Session

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



10
11
12
# File 'lib/warden/test/mock.rb', line 10

def self.included(base)
  ::Warden.test_mode!
end

Instance Method Details

#wardenObject

A helper method that provides the warden object by mocking the env variable.



16
17
18
19
20
# File 'lib/warden/test/mock.rb', line 16

def warden
  @warden ||= begin
    env['warden']
  end
end