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

MockSignedCookieJar

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#set_cookiesObject

:nodoc:



5
6
7
# File 'lib/authlogic/test_case/mock_cookie_jar.rb', line 5

def set_cookies
  @set_cookies
end

Instance Method Details

#[](key) ⇒ Object



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

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

#[]=(key, options) ⇒ Object



12
13
14
15
# File 'lib/authlogic/test_case/mock_cookie_jar.rb', line 12

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

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



17
18
19
# File 'lib/authlogic/test_case/mock_cookie_jar.rb', line 17

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

#signedObject



21
22
23
# File 'lib/authlogic/test_case/mock_cookie_jar.rb', line 21

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