Class: Authlogic::TestCase::MockCookieJar

Inherits:
Hash
  • Object
show all
Defined in:
lib/authlogic/test_case/mock_cookie_jar.rb

Overview

A mock of `ActionDispatch::Cookies::CookieJar`.

Direct Known Subclasses

MockEncryptedCookieJar, MockSignedCookieJar

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#set_cookiesObject

:nodoc:


7
8
9
# File 'lib/authlogic/test_case/mock_cookie_jar.rb', line 7

def set_cookies
  @set_cookies
end

Instance Method Details

#[](key) ⇒ Object


9
10
11
12
# File 'lib/authlogic/test_case/mock_cookie_jar.rb', line 9

def [](key)
  hash = super
  hash && hash[:value]
end

#[]=(key, options) ⇒ Object


14
15
16
17
# File 'lib/authlogic/test_case/mock_cookie_jar.rb', line 14

def []=(key, options)
  (@set_cookies ||= {})[key.to_s] = options
  super
end

#delete(key, _options = {}) ⇒ Object


19
20
21
# File 'lib/authlogic/test_case/mock_cookie_jar.rb', line 19

def delete(key, _options = {})
  super(key)
end

#encryptedObject


27
28
29
# File 'lib/authlogic/test_case/mock_cookie_jar.rb', line 27

def encrypted
  @encrypted ||= MockEncryptedCookieJar.new(self)
end

#signedObject


23
24
25
# File 'lib/authlogic/test_case/mock_cookie_jar.rb', line 23

def signed
  @signed ||= MockSignedCookieJar.new(self)
end